From 2bc9bace716fafa408dfc6683ca3ff0f9d8bc44b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 29 Apr 2021 17:52:18 +0200 Subject: lexer: fix infinite loop on parsing unterminated expression blocks Signed-off-by: Jo-Philipp Wich --- .../custom/03_bugs/17_hang_on_unclosed_expression_block | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/custom/03_bugs/17_hang_on_unclosed_expression_block (limited to 'tests') diff --git a/tests/custom/03_bugs/17_hang_on_unclosed_expression_block b/tests/custom/03_bugs/17_hang_on_unclosed_expression_block new file mode 100644 index 0000000..25128bb --- /dev/null +++ b/tests/custom/03_bugs/17_hang_on_unclosed_expression_block @@ -0,0 +1,16 @@ +When parsing an unclosed expression block, the lexer did end up in an +infinite loop. + +-- Expect stderr -- +Syntax error: Unterminated template block +In line 1, byte 6: + + `{{ 1` + ^-- Near here + + +-- End -- + +-- Testcase -- +{{ 1 +-- End -- -- cgit v1.2.3