Skip to content

Commit

Permalink
fix: add no_injection_text to fix #23
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Oct 13, 2024
1 parent fd9e1c6 commit 3429749
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion make_grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
31 changes: 31 additions & 0 deletions test/corpus/text.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 3429749

Please sign in to comment.