caddy/caddyconfig/caddyfile
Matthew Holt c12bf4054c
caddyfile: Fix lexer behavior with regards to escaped newlines
Newlines (\n) can be escaped outside of quoted areas and the newline
will be treated as whitespace but not as an actual line break. Escaping
newlines inside a quoted area is not necessary, and because quotes
trigger literal interpretation of the contents, the escaping backslash
will be parsed as a literal backslash, and the newline will not be
escaped.

Caveat: When a newline is escaped, tokens after it until an unescaped
newline will appear to the parser be on the same line as the initial
token after the last unescaped newline. This may technically lead to
some false line numbers if errors are given, but escaped newlines are
counted so that the next token after an unescaped newline is correct.

See #2766
2019-09-28 21:18:36 -06:00
..
testdata Implement config adapters and beginning of Caddyfile adapter 2019-08-09 12:05:47 -06:00
adapter.go caddyfile: Support global config block; allow non-empty blocks w/ 0 keys 2019-08-22 13:38:37 -06:00
dispenser_test.go caddyfile: Improve Dispenser.NextBlock() to support nesting 2019-09-10 19:21:52 -06:00
dispenser.go caddyfile: Improve Dispenser.NextBlock() to support nesting 2019-09-10 19:21:52 -06:00
lexer_test.go caddyfile: Fix lexer behavior with regards to escaped newlines 2019-09-28 21:18:36 -06:00
lexer.go caddyfile: Fix lexer behavior with regards to escaped newlines 2019-09-28 21:18:36 -06:00
parse_test.go httpcaddyfile: static_response -> respond; minor cleanups 2019-09-16 11:04:18 -06:00
parse.go caddyfile: Support global config block; allow non-empty blocks w/ 0 keys 2019-08-22 13:38:37 -06:00