Commit Graph

5 Commits

Author SHA1 Message Date
Martin Atkins
7887810587 specsuite: Fix some regressions
Lately we've made some changes that have affected the behavior of the
specsuite tests, causing them to fail. Much of this was caused by changes
to the harness itself (based on hcldec), although one break in particular
here was an intentional change to the implementation of modulo in
upstream cty to make it produce a more accurate result when used with
a fractional divisor.
2021-02-23 09:05:19 -08:00
Martin Atkins
ee38c67330 specsuite: Tests for the expression language operators 2019-10-01 15:59:10 -07:00
Martin Atkins
48fbad7bf4 specsuite: tests for primitive type literals 2019-10-01 15:59:10 -07:00
Aaron Gallagher
65731f3310 specsuite: tests for flush heredocs with empty lines 2019-08-05 16:24:22 -07:00
Martin Atkins
e8dbb16dbc hcl/hclsyntax: Fix up parsing of flush heredocs
This was implemented a long time ago in the original template parser, but
it was missed in the rewrite of the template parser to make it use a
two-stage parsing strategy.

It's implemented as a post-processing step on the result of the first
stage of parsing, which produces a flat sequence of literal strings,
interpolation markers, and control markers, and prior to the second stage
which matches opening and closing control markers to produce an expression
AST.

It's important to do this at parse time rather than eval time since it is
the static layout of the source code that decides the indentation level,
and so an interpolation marker at the start of a line that itself produces
spaces does not affect the result.
2018-12-13 17:22:41 -08:00