doc: add a note describing lexer state transitions
This commit is contained in:
14
doc/lex/lexer-states.txt
Normal file
14
doc/lex/lexer-states.txt
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
possible lexer states:
|
||||||
|
STATE_NORMAL
|
||||||
|
STATE_STRING
|
||||||
|
STATE_FSTRING
|
||||||
|
STATE_INTERPOLATION
|
||||||
|
|
||||||
|
|
||||||
|
state transitions:
|
||||||
|
STATE_NORMAL + " -> push STATE_STRING
|
||||||
|
STATE_NORMAL + ' -> push STATE_FSTRING
|
||||||
|
STATE_STRING + " -> pop
|
||||||
|
STATE_FSTRING + { -> push STATE_INTERPOLATION, record brace depth
|
||||||
|
STATE_FSTRING + ' -> pop
|
||||||
|
STATE_INTERPOLATION + } (at recorded brace depth) -> pop
|
||||||
Reference in New Issue
Block a user