hcl/zcl/zclsyntax
Martin Atkins 18e45ec05c zclsyntax: scanner support of string templates
This requires some extra state-keeping because we allow templates to be
nested inside templates. This takes us outside of the world of regular
languages, but we accept that here because it makes things easier to
deal with down the line in the parser.

The methodology is to keep track of how many braces are open at a given
time and then, when a nested template interpolation begins, record the
current brace level. Then, when a closing brace is encountered, if its
nesting level is at the top of the stack then we pop off the stack and
return to "main" parsing mode.

Ragel's existing idea of calling and returning from machines is important
here too. As this currently stands this is not actually needed, but once
heredocs are in play we will have two possible places to return to at
the end of an interpolation sequence, so the state return stack maintained
by Ragel will determine whether to return to string mode or heredoc mode.
2017-05-28 15:33:01 -07:00
..
didyoumean_test.go zclsyntax: "Did you mean ...?" helper function 2017-05-25 07:14:29 -07:00
didyoumean.go zclsyntax: "Did you mean ...?" helper function 2017-05-25 07:14:29 -07:00
doc.go zclsyntax: Start to stub out the zclsyntax package 2017-05-23 08:05:44 -07:00
expression_test.go Update cty references to its new home in the zclconf github account 2017-05-27 17:35:44 -07:00
expression_vars_gen.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
expression_vars.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
expression.go Update cty references to its new home in the zclconf github account 2017-05-27 17:35:44 -07:00
file.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
generate.go zclsyntax: identifiers in the scanner 2017-05-28 09:16:53 -07:00
node.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
scan_tokens_test.go zclsyntax: scanner support of string templates 2017-05-28 15:33:01 -07:00
scan_tokens.go zclsyntax: scanner support of string templates 2017-05-28 15:33:01 -07:00
scan_tokens.rl zclsyntax: scanner support of string templates 2017-05-28 15:33:01 -07:00
structure.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
token_type_string.go zclsyntax: scan multi-character punctuation tokens 2017-05-28 09:40:58 -07:00
token.go zclsyntax: heredoc to be separate start/end tokens 2017-05-28 09:36:32 -07:00
unicode2ragel.rb zclsyntax: identifiers in the scanner 2017-05-28 09:16:53 -07:00
unicode_derived.rl zclsyntax: identifiers in the scanner 2017-05-28 09:16:53 -07:00
variables.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
walk.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00