diff --git a/src/scanner.c b/src/scanner.c index 6ac5bf6..5247c57 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -3,6 +3,7 @@ #include #include #include +#include enum TokenType { QUOTED_TEMPLATE_START, @@ -63,6 +64,7 @@ void scanner_enter_interpolation_context(Scanner *scanner) { } void scanner_exit_interpolation_context(Scanner *scanner) { + assert(scanner->template_interpolation_depth > 0); scanner->template_interpolation_depth--; scanner->in_template_interpolation = false; if (scanner->quoted_context_depth > 0) { @@ -77,6 +79,7 @@ void scanner_enter_quoted_context(Scanner *scanner) { } void scanner_exit_quoted_context(Scanner *scanner) { + assert(scanner->quoted_context_depth > 0); scanner->quoted_context_depth--; scanner->in_quoted_context = false; if (scanner->template_interpolation_depth > 0) {