grammar: don't use immediate token in the escape sequence...

to fix first character in the connection path shape key

Related #21
This commit is contained in:
Dmitriy Pleshevskiy 2023-06-21 17:49:14 +03:00
parent fdcb5613a5
commit 6b5e1d9123
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
6 changed files with 33 additions and 2 deletions

View file

@ -419,7 +419,7 @@ module.exports = grammar({
_unescaped_double_string_fragment: ($) => token.immediate(/[^"\\\n]+/), _unescaped_double_string_fragment: ($) => token.immediate(/[^"\\\n]+/),
escape_sequence: ($) => escape_sequence: ($) =>
token.immediate( token(
seq( seq(
"\\", "\\",
choice( choice(

View file

@ -2155,7 +2155,7 @@
} }
}, },
"escape_sequence": { "escape_sequence": {
"type": "IMMEDIATE_TOKEN", "type": "TOKEN",
"content": { "content": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [

Binary file not shown.

View file

@ -245,3 +245,26 @@ Connection with espaced key fragments
) )
) )
) )
================================================================================
Connection with espaced key fragments
================================================================================
\#hello\[\] -- \[world\]
--------------------------------------------------------------------------------
(source_file
(connection
(shape_key
(escape_sequence)
(escape_sequence)
(escape_sequence)
)
(arrow)
(shape_key
(escape_sequence)
(escape_sequence)
)
)
)

View file

@ -3,6 +3,7 @@ Declare unquoted shape identifier with escape sequence (issue #21)
================================================================================ ================================================================================
hello\[world\] hello\[world\]
\#ello\[world\] \#ello\[world\]
\# helloello\[world\]
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
(source_file (source_file
@ -19,6 +20,13 @@ hello\[world\]
(escape_sequence) (escape_sequence)
) )
) )
(shape
(shape_key
(escape_sequence)
(escape_sequence)
(escape_sequence)
)
)
) )
================================================================================ ================================================================================

Binary file not shown.