diff --git a/make_grammar.js b/make_grammar.js index fe29af5..46bb529 100644 --- a/make_grammar.js +++ b/make_grammar.js @@ -76,7 +76,9 @@ module.exports = function make_grammar(dialect) { rules: { template: ($) => repeat($._block), - _block: ($) => choice($.text, $._action), + _block: ($) => choice($.yaml_no_injection_text, $.text, $._action), + + yaml_no_injection_text: ($) => choice('-'), text: ($) => choice( diff --git a/test/corpus/text.txt b/test/corpus/text.txt index 31e34a6..92c36ac 100644 --- a/test/corpus/text.txt +++ b/test/corpus/text.txt @@ -33,3 +33,34 @@ Invalid curly brackets combination inside text block (function_call (identifier)) (text) (ERROR))) + +==================================== +No injection text +==================================== +foo: + bar: {{ .Values.foo.bar }}-{{ .Values.foo.bar }} +--- +(template + (text) + (selector_expression + (selector_expression + (field + (identifier)) + (field_identifier)) + (field_identifier)) + (yaml_no_injection_text) + (selector_expression + (selector_expression + (field + (identifier)) + (field_identifier)) + (field_identifier))) + +==================================== +Normal text +==================================== +this: + - is a yaml-list +--- +(template + (text))