diff --git a/grammar.js b/grammar.js index f18337d..b6e4702 100644 --- a/grammar.js +++ b/grammar.js @@ -39,7 +39,9 @@ module.exports = grammar({ $._attr_value_ruby_p, // () $._attr_value_ruby_s, // [] $._attr_value_ruby_b, // {} - $.ruby + $.ruby, + + $._error_sentinel ], rules: { diff --git a/src/grammar.json b/src/grammar.json index f5913ba..6689bb6 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1579,6 +1579,10 @@ { "type": "SYMBOL", "name": "ruby" + }, + { + "type": "SYMBOL", + "name": "_error_sentinel" } ], "inline": [], diff --git a/src/scanner.cc b/src/scanner.cc index 1d33cd1..b555f4b 100644 --- a/src/scanner.cc +++ b/src/scanner.cc @@ -18,7 +18,9 @@ enum TokenType { ATTR_VALUE_RUBY_P, ATTR_VALUE_RUBY_S, ATTR_VALUE_RUBY_B, - RUBY + RUBY, + + ERROR_SENTINEL }; class Scanner { @@ -186,7 +188,7 @@ class Scanner { } } - if (valid_symbols[RUBY]) { + if (valid_symbols[RUBY] && !valid_symbols[ERROR_SENTINEL]) { return scan_ruby(lexer); }