fix: prevent zero length tokens in raw-blocks (#1577)

This comment ensures that the lexer is not stuck on zero-length tokens, in raw-blocks like {{{{a}}}} {{{{/a}}}}
This commit is contained in:
Nils Knappmeier
2019-10-20 21:23:02 +02:00
committed by GitHub
parent feb60f85c9
commit aaab6099f2
3 changed files with 30 additions and 9 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ ID [^\s!"#%-,\.\/;->@\[-\^`\{-~]+/{LOOKAHEAD}
return 'END_RAW_BLOCK';
}
}
<raw>[^\x00]*?/("{{{{") { return 'CONTENT'; }
<raw>[^\x00]+/("{{{{") { return 'CONTENT'; }
<com>[\s\S]*?"--"{RIGHT_STRIP}?"}}" {
this.popState();
+1 -1
View File
@@ -39,7 +39,7 @@ content
};
rawBlock
: openRawBlock content+ END_RAW_BLOCK -> yy.prepareRawBlock($1, $2, $3, @$)
: openRawBlock content* END_RAW_BLOCK -> yy.prepareRawBlock($1, $2, $3, @$)
;
openRawBlock