Repository navigation
This release adds #elif and fixes a long list of cases where xvcl produced wrong or invalid VCL.
Every complete example and test output now compiles with both Falco and Fastly's own compiler.
New
#elifbranches in conditionals.- Compound assignments such as
set req.hash += normalize(req.url);work with function calls. - A function can return the result of another function, and
returnworks inside one-line blocks.
Changes that may need updates to your sources
- Function parameters and results can no longer be
FLOAT.
VCL rounds a FLOAT to three decimals when it becomes a string, so these values were silently wrong. - Function names that Fastly or Falco reserve, such as
add,logorregsub, are refused, since the generated VCL couldn't compile. - Nested function calls, and calls that aren't the whole right side of a
set, are reported instead of producing broken VCL. - A stray
#endif,#endforor#elseis an error, instead of silently cutting off the rest of the output. - A file that produces VCL can't be included again when its first include was inside an
#if.
Fixes
- The headers used to pass function arguments and results are removed once read, so they no longer reach the origin.
- VCL strings are read without backslash escapes,
{{ }}expressions are read as Python, and heredoc delimiters may contain digits.
Before, code from a false#ifbranch could end up in the output. - Text that looks like a directive inside a multi-line comment or string is no longer treated as one.
- Macro parameters are replaced all at once, so an argument is never rewritten again.
- Multi-line directives work inside
#defbodies and next to multi-line calls. - A constant can use constants from files included before it.
- Errors point at the right file and line after includes, inside
#defbodies and after multi-line directives, and the error that stopped compilation is always shown. - Floats in templates don't use exponents in VCL code anymore, since Falco rejects them.
- Colors are only used when the output is a terminal.
- The ipcrypt-pfx example compiles with Fastly.