@@ -28,7 +28,7 @@ module.exports = grammar({
2828
2929 word : ( $ ) => $ . _identifier ,
3030
31- extras : ( $ ) => [ $ . comment , / [ \s \uFEFF \u2060 \u200B ] / ] ,
31+ extras : ( $ ) => [ $ . comment , / [ \s \uFEFF \u2060 \u200B ] / , $ . line_continuation ] ,
3232
3333 externals : ( $ ) => [
3434 $ . _newline ,
@@ -176,25 +176,15 @@ module.exports = grammar({
176176 seq (
177177 optional ( "/" ) ,
178178 $ . _identifier ,
179- repeat (
180- // It's valid syntax in GDScript to wrap get node paths with
181- // $ or % over multiple lines with line continuation marks.
182- // But the continuation mark can only come after a trailing /
183- seq ( "/" , optional ( $ . _line_continuation ) , $ . _identifier ) ,
184- ) ,
179+ repeat ( seq ( "/" , $ . _identifier ) ) ,
185180 ) ,
186181 ) ,
187182 ) ,
188183 seq (
189184 "%" ,
190185 choice (
191186 alias ( $ . string , "value" ) ,
192- seq (
193- $ . _identifier ,
194- repeat (
195- seq ( "/" , optional ( $ . _line_continuation ) , $ . _identifier ) ,
196- ) ,
197- ) ,
187+ seq ( $ . _identifier , repeat ( seq ( "/" , $ . _identifier ) ) ) ,
198188 ) ,
199189 ) ,
200190 ) ,
@@ -839,8 +829,7 @@ module.exports = grammar({
839829 // This rule is for trailing backslashes to indicate line continuation. We
840830 // capture those as anonymous '\' tokens to be able to preserve them in code
841831 // formatters.
842- line_continuation : ( $ ) => token ( prec ( 1 , seq ( "\\" , / \r ? \n / ) ) ) ,
843- _line_continuation : ( $ ) => alias ( $ . line_continuation , "" ) ,
832+ line_continuation : ( $ ) => token ( seq ( "\\" , / \r ? \n / ) ) ,
844833 } , // end rules
845834} ) ;
846835
0 commit comments