File tree Expand file tree Collapse file tree 4 files changed +69869
-68882
lines changed Expand file tree Collapse file tree 4 files changed +69869
-68882
lines changed Original file line number Diff line number Diff line change @@ -891,7 +891,23 @@ module.exports = grammar({
891
891
$ . _reserved_identifier ,
892
892
) ) ,
893
893
'!' ,
894
- $ . token_tree
894
+ alias ( $ . delim_token_tree , $ . token_tree )
895
+ ) ,
896
+
897
+ delim_token_tree : $ => choice (
898
+ seq ( '(' , repeat ( $ . _delim_tokens ) , ')' ) ,
899
+ seq ( '[' , repeat ( $ . _delim_tokens ) , ']' ) ,
900
+ seq ( '{' , repeat ( $ . _delim_tokens ) , '}' )
901
+ ) ,
902
+
903
+ _delim_tokens : $ => choice (
904
+ $ . _non_delim_token ,
905
+ alias ( $ . delim_token_tree , $ . token_tree ) ,
906
+ ) ,
907
+
908
+ _non_delim_token : $ => choice (
909
+ $ . _non_special_token ,
910
+ '$'
895
911
) ,
896
912
897
913
scoped_identifier : $ => seq (
Original file line number Diff line number Diff line change 4927
4927
"type" : " STRING" ,
4928
4928
"value" : " !"
4929
4929
},
4930
+ {
4931
+ "type" : " ALIAS" ,
4932
+ "content" : {
4933
+ "type" : " SYMBOL" ,
4934
+ "name" : " delim_token_tree"
4935
+ },
4936
+ "named" : true ,
4937
+ "value" : " token_tree"
4938
+ }
4939
+ ]
4940
+ },
4941
+ "delim_token_tree" : {
4942
+ "type" : " CHOICE" ,
4943
+ "members" : [
4944
+ {
4945
+ "type" : " SEQ" ,
4946
+ "members" : [
4947
+ {
4948
+ "type" : " STRING" ,
4949
+ "value" : " ("
4950
+ },
4951
+ {
4952
+ "type" : " REPEAT" ,
4953
+ "content" : {
4954
+ "type" : " SYMBOL" ,
4955
+ "name" : " _delim_tokens"
4956
+ }
4957
+ },
4958
+ {
4959
+ "type" : " STRING" ,
4960
+ "value" : " )"
4961
+ }
4962
+ ]
4963
+ },
4964
+ {
4965
+ "type" : " SEQ" ,
4966
+ "members" : [
4967
+ {
4968
+ "type" : " STRING" ,
4969
+ "value" : " ["
4970
+ },
4971
+ {
4972
+ "type" : " REPEAT" ,
4973
+ "content" : {
4974
+ "type" : " SYMBOL" ,
4975
+ "name" : " _delim_tokens"
4976
+ }
4977
+ },
4978
+ {
4979
+ "type" : " STRING" ,
4980
+ "value" : " ]"
4981
+ }
4982
+ ]
4983
+ },
4984
+ {
4985
+ "type" : " SEQ" ,
4986
+ "members" : [
4987
+ {
4988
+ "type" : " STRING" ,
4989
+ "value" : " {"
4990
+ },
4991
+ {
4992
+ "type" : " REPEAT" ,
4993
+ "content" : {
4994
+ "type" : " SYMBOL" ,
4995
+ "name" : " _delim_tokens"
4996
+ }
4997
+ },
4998
+ {
4999
+ "type" : " STRING" ,
5000
+ "value" : " }"
5001
+ }
5002
+ ]
5003
+ }
5004
+ ]
5005
+ },
5006
+ "_delim_tokens" : {
5007
+ "type" : " CHOICE" ,
5008
+ "members" : [
4930
5009
{
4931
5010
"type" : " SYMBOL" ,
4932
- "name" : " token_tree"
5011
+ "name" : " _non_delim_token"
5012
+ },
5013
+ {
5014
+ "type" : " ALIAS" ,
5015
+ "content" : {
5016
+ "type" : " SYMBOL" ,
5017
+ "name" : " delim_token_tree"
5018
+ },
5019
+ "named" : true ,
5020
+ "value" : " token_tree"
5021
+ }
5022
+ ]
5023
+ },
5024
+ "_non_delim_token" : {
5025
+ "type" : " CHOICE" ,
5026
+ "members" : [
5027
+ {
5028
+ "type" : " SYMBOL" ,
5029
+ "name" : " _non_special_token"
5030
+ },
5031
+ {
5032
+ "type" : " STRING" ,
5033
+ "value" : " $"
4933
5034
}
4934
5035
]
4935
5036
},
You can’t perform that action at this time.
0 commit comments