Skip to content

2.9.0

Latest

Choose a tag to compare

@jedisct1 jedisct1 released this 18 Nov 14:50

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

  • #elif branches 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 return works 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, log or regsub, 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, #endfor or #else is 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 #if branch 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 #def bodies 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 #def bodies 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.