diff --git a/grammar.js b/grammar.js index f801526..f56928a 100644 --- a/grammar.js +++ b/grammar.js @@ -295,7 +295,7 @@ module.exports = grammar({ charlist: ($) => choice($._quoted_i_single, $._quoted_i_heredoc_single), - interpolation: ($) => seq("#{", $._expression, "}"), + interpolation: ($) => seq("#{", optional($._expression), "}"), escape_sequence: ($) => token( diff --git a/test/corpus/term/string.txt b/test/corpus/term/string.txt index 9869797..ed776bd 100644 --- a/test/corpus/term/string.txt +++ b/test/corpus/term/string.txt @@ -81,6 +81,18 @@ nested interpolation (integer)))) (quoted_content))) +===================================== +empty interpolation +===================================== + +"#{}" + +--- + +(source + (string + (interpolation))) + ===================================== escape sequence =====================================