@hew-lang/tree-sitter-hew 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.js +96 -19
- package/package.json +1 -1
- package/queries/highlights.scm +21 -1
- package/src/grammar.json +472 -28
- package/src/node-types.json +358 -0
- package/src/parser.c +51146 -31964
- package/tree-sitter.json +1 -1
package/src/grammar.json
CHANGED
|
@@ -79,6 +79,10 @@
|
|
|
79
79
|
"type": "SYMBOL",
|
|
80
80
|
"name": "supervisor_declaration"
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
"type": "SYMBOL",
|
|
84
|
+
"name": "machine_declaration"
|
|
85
|
+
},
|
|
82
86
|
{
|
|
83
87
|
"type": "SYMBOL",
|
|
84
88
|
"name": "type_alias"
|
|
@@ -742,6 +746,10 @@
|
|
|
742
746
|
{
|
|
743
747
|
"type": "STRING",
|
|
744
748
|
"value": "enum"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"type": "STRING",
|
|
752
|
+
"value": "type"
|
|
745
753
|
}
|
|
746
754
|
]
|
|
747
755
|
},
|
|
@@ -2726,6 +2734,323 @@
|
|
|
2726
2734
|
}
|
|
2727
2735
|
]
|
|
2728
2736
|
},
|
|
2737
|
+
"machine_declaration": {
|
|
2738
|
+
"type": "SEQ",
|
|
2739
|
+
"members": [
|
|
2740
|
+
{
|
|
2741
|
+
"type": "CHOICE",
|
|
2742
|
+
"members": [
|
|
2743
|
+
{
|
|
2744
|
+
"type": "SYMBOL",
|
|
2745
|
+
"name": "visibility"
|
|
2746
|
+
},
|
|
2747
|
+
{
|
|
2748
|
+
"type": "BLANK"
|
|
2749
|
+
}
|
|
2750
|
+
]
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
"type": "STRING",
|
|
2754
|
+
"value": "machine"
|
|
2755
|
+
},
|
|
2756
|
+
{
|
|
2757
|
+
"type": "FIELD",
|
|
2758
|
+
"name": "name",
|
|
2759
|
+
"content": {
|
|
2760
|
+
"type": "SYMBOL",
|
|
2761
|
+
"name": "identifier"
|
|
2762
|
+
}
|
|
2763
|
+
},
|
|
2764
|
+
{
|
|
2765
|
+
"type": "STRING",
|
|
2766
|
+
"value": "{"
|
|
2767
|
+
},
|
|
2768
|
+
{
|
|
2769
|
+
"type": "REPEAT",
|
|
2770
|
+
"content": {
|
|
2771
|
+
"type": "CHOICE",
|
|
2772
|
+
"members": [
|
|
2773
|
+
{
|
|
2774
|
+
"type": "SYMBOL",
|
|
2775
|
+
"name": "machine_state"
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
"type": "SYMBOL",
|
|
2779
|
+
"name": "machine_event"
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
"type": "SYMBOL",
|
|
2783
|
+
"name": "machine_transition"
|
|
2784
|
+
},
|
|
2785
|
+
{
|
|
2786
|
+
"type": "SYMBOL",
|
|
2787
|
+
"name": "machine_default"
|
|
2788
|
+
}
|
|
2789
|
+
]
|
|
2790
|
+
}
|
|
2791
|
+
},
|
|
2792
|
+
{
|
|
2793
|
+
"type": "STRING",
|
|
2794
|
+
"value": "}"
|
|
2795
|
+
}
|
|
2796
|
+
]
|
|
2797
|
+
},
|
|
2798
|
+
"machine_state": {
|
|
2799
|
+
"type": "SEQ",
|
|
2800
|
+
"members": [
|
|
2801
|
+
{
|
|
2802
|
+
"type": "STRING",
|
|
2803
|
+
"value": "state"
|
|
2804
|
+
},
|
|
2805
|
+
{
|
|
2806
|
+
"type": "FIELD",
|
|
2807
|
+
"name": "name",
|
|
2808
|
+
"content": {
|
|
2809
|
+
"type": "SYMBOL",
|
|
2810
|
+
"name": "identifier"
|
|
2811
|
+
}
|
|
2812
|
+
},
|
|
2813
|
+
{
|
|
2814
|
+
"type": "CHOICE",
|
|
2815
|
+
"members": [
|
|
2816
|
+
{
|
|
2817
|
+
"type": "SEQ",
|
|
2818
|
+
"members": [
|
|
2819
|
+
{
|
|
2820
|
+
"type": "STRING",
|
|
2821
|
+
"value": "{"
|
|
2822
|
+
},
|
|
2823
|
+
{
|
|
2824
|
+
"type": "REPEAT",
|
|
2825
|
+
"content": {
|
|
2826
|
+
"type": "SYMBOL",
|
|
2827
|
+
"name": "struct_field"
|
|
2828
|
+
}
|
|
2829
|
+
},
|
|
2830
|
+
{
|
|
2831
|
+
"type": "STRING",
|
|
2832
|
+
"value": "}"
|
|
2833
|
+
}
|
|
2834
|
+
]
|
|
2835
|
+
},
|
|
2836
|
+
{
|
|
2837
|
+
"type": "BLANK"
|
|
2838
|
+
}
|
|
2839
|
+
]
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
"type": "CHOICE",
|
|
2843
|
+
"members": [
|
|
2844
|
+
{
|
|
2845
|
+
"type": "STRING",
|
|
2846
|
+
"value": ";"
|
|
2847
|
+
},
|
|
2848
|
+
{
|
|
2849
|
+
"type": "BLANK"
|
|
2850
|
+
}
|
|
2851
|
+
]
|
|
2852
|
+
}
|
|
2853
|
+
]
|
|
2854
|
+
},
|
|
2855
|
+
"machine_event": {
|
|
2856
|
+
"type": "SEQ",
|
|
2857
|
+
"members": [
|
|
2858
|
+
{
|
|
2859
|
+
"type": "STRING",
|
|
2860
|
+
"value": "event"
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
"type": "FIELD",
|
|
2864
|
+
"name": "name",
|
|
2865
|
+
"content": {
|
|
2866
|
+
"type": "SYMBOL",
|
|
2867
|
+
"name": "identifier"
|
|
2868
|
+
}
|
|
2869
|
+
},
|
|
2870
|
+
{
|
|
2871
|
+
"type": "CHOICE",
|
|
2872
|
+
"members": [
|
|
2873
|
+
{
|
|
2874
|
+
"type": "SEQ",
|
|
2875
|
+
"members": [
|
|
2876
|
+
{
|
|
2877
|
+
"type": "STRING",
|
|
2878
|
+
"value": "{"
|
|
2879
|
+
},
|
|
2880
|
+
{
|
|
2881
|
+
"type": "REPEAT",
|
|
2882
|
+
"content": {
|
|
2883
|
+
"type": "SYMBOL",
|
|
2884
|
+
"name": "struct_field"
|
|
2885
|
+
}
|
|
2886
|
+
},
|
|
2887
|
+
{
|
|
2888
|
+
"type": "STRING",
|
|
2889
|
+
"value": "}"
|
|
2890
|
+
}
|
|
2891
|
+
]
|
|
2892
|
+
},
|
|
2893
|
+
{
|
|
2894
|
+
"type": "BLANK"
|
|
2895
|
+
}
|
|
2896
|
+
]
|
|
2897
|
+
},
|
|
2898
|
+
{
|
|
2899
|
+
"type": "CHOICE",
|
|
2900
|
+
"members": [
|
|
2901
|
+
{
|
|
2902
|
+
"type": "STRING",
|
|
2903
|
+
"value": ";"
|
|
2904
|
+
},
|
|
2905
|
+
{
|
|
2906
|
+
"type": "BLANK"
|
|
2907
|
+
}
|
|
2908
|
+
]
|
|
2909
|
+
}
|
|
2910
|
+
]
|
|
2911
|
+
},
|
|
2912
|
+
"machine_transition": {
|
|
2913
|
+
"type": "SEQ",
|
|
2914
|
+
"members": [
|
|
2915
|
+
{
|
|
2916
|
+
"type": "STRING",
|
|
2917
|
+
"value": "on"
|
|
2918
|
+
},
|
|
2919
|
+
{
|
|
2920
|
+
"type": "FIELD",
|
|
2921
|
+
"name": "event",
|
|
2922
|
+
"content": {
|
|
2923
|
+
"type": "SYMBOL",
|
|
2924
|
+
"name": "identifier"
|
|
2925
|
+
}
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
"type": "STRING",
|
|
2929
|
+
"value": ":"
|
|
2930
|
+
},
|
|
2931
|
+
{
|
|
2932
|
+
"type": "FIELD",
|
|
2933
|
+
"name": "source",
|
|
2934
|
+
"content": {
|
|
2935
|
+
"type": "SYMBOL",
|
|
2936
|
+
"name": "identifier"
|
|
2937
|
+
}
|
|
2938
|
+
},
|
|
2939
|
+
{
|
|
2940
|
+
"type": "STRING",
|
|
2941
|
+
"value": "->"
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
"type": "FIELD",
|
|
2945
|
+
"name": "target",
|
|
2946
|
+
"content": {
|
|
2947
|
+
"type": "SYMBOL",
|
|
2948
|
+
"name": "identifier"
|
|
2949
|
+
}
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
"type": "CHOICE",
|
|
2953
|
+
"members": [
|
|
2954
|
+
{
|
|
2955
|
+
"type": "SEQ",
|
|
2956
|
+
"members": [
|
|
2957
|
+
{
|
|
2958
|
+
"type": "STRING",
|
|
2959
|
+
"value": "when"
|
|
2960
|
+
},
|
|
2961
|
+
{
|
|
2962
|
+
"type": "FIELD",
|
|
2963
|
+
"name": "guard",
|
|
2964
|
+
"content": {
|
|
2965
|
+
"type": "SYMBOL",
|
|
2966
|
+
"name": "expression"
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
]
|
|
2970
|
+
},
|
|
2971
|
+
{
|
|
2972
|
+
"type": "BLANK"
|
|
2973
|
+
}
|
|
2974
|
+
]
|
|
2975
|
+
},
|
|
2976
|
+
{
|
|
2977
|
+
"type": "CHOICE",
|
|
2978
|
+
"members": [
|
|
2979
|
+
{
|
|
2980
|
+
"type": "STRING",
|
|
2981
|
+
"value": ";"
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
"type": "SEQ",
|
|
2985
|
+
"members": [
|
|
2986
|
+
{
|
|
2987
|
+
"type": "STRING",
|
|
2988
|
+
"value": "{"
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
"type": "REPEAT",
|
|
2992
|
+
"content": {
|
|
2993
|
+
"type": "CHOICE",
|
|
2994
|
+
"members": [
|
|
2995
|
+
{
|
|
2996
|
+
"type": "SYMBOL",
|
|
2997
|
+
"name": "field_initializer"
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
"type": "SYMBOL",
|
|
3001
|
+
"name": "_statement"
|
|
3002
|
+
}
|
|
3003
|
+
]
|
|
3004
|
+
}
|
|
3005
|
+
},
|
|
3006
|
+
{
|
|
3007
|
+
"type": "STRING",
|
|
3008
|
+
"value": "}"
|
|
3009
|
+
}
|
|
3010
|
+
]
|
|
3011
|
+
}
|
|
3012
|
+
]
|
|
3013
|
+
}
|
|
3014
|
+
]
|
|
3015
|
+
},
|
|
3016
|
+
"machine_default": {
|
|
3017
|
+
"type": "SEQ",
|
|
3018
|
+
"members": [
|
|
3019
|
+
{
|
|
3020
|
+
"type": "STRING",
|
|
3021
|
+
"value": "default"
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
"type": "CHOICE",
|
|
3025
|
+
"members": [
|
|
3026
|
+
{
|
|
3027
|
+
"type": "SEQ",
|
|
3028
|
+
"members": [
|
|
3029
|
+
{
|
|
3030
|
+
"type": "STRING",
|
|
3031
|
+
"value": "{"
|
|
3032
|
+
},
|
|
3033
|
+
{
|
|
3034
|
+
"type": "REPEAT",
|
|
3035
|
+
"content": {
|
|
3036
|
+
"type": "SYMBOL",
|
|
3037
|
+
"name": "_statement"
|
|
3038
|
+
}
|
|
3039
|
+
},
|
|
3040
|
+
{
|
|
3041
|
+
"type": "STRING",
|
|
3042
|
+
"value": "}"
|
|
3043
|
+
}
|
|
3044
|
+
]
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
"type": "STRING",
|
|
3048
|
+
"value": ";"
|
|
3049
|
+
}
|
|
3050
|
+
]
|
|
3051
|
+
}
|
|
3052
|
+
]
|
|
3053
|
+
},
|
|
2729
3054
|
"extern_block": {
|
|
2730
3055
|
"type": "SEQ",
|
|
2731
3056
|
"members": [
|
|
@@ -3104,19 +3429,19 @@
|
|
|
3104
3429
|
},
|
|
3105
3430
|
{
|
|
3106
3431
|
"type": "STRING",
|
|
3107
|
-
"value": "
|
|
3432
|
+
"value": "isize"
|
|
3108
3433
|
},
|
|
3109
3434
|
{
|
|
3110
3435
|
"type": "STRING",
|
|
3111
|
-
"value": "
|
|
3436
|
+
"value": "usize"
|
|
3112
3437
|
},
|
|
3113
3438
|
{
|
|
3114
3439
|
"type": "STRING",
|
|
3115
|
-
"value": "
|
|
3440
|
+
"value": "f32"
|
|
3116
3441
|
},
|
|
3117
3442
|
{
|
|
3118
3443
|
"type": "STRING",
|
|
3119
|
-
"value": "
|
|
3444
|
+
"value": "f64"
|
|
3120
3445
|
},
|
|
3121
3446
|
{
|
|
3122
3447
|
"type": "STRING",
|
|
@@ -3956,6 +4281,10 @@
|
|
|
3956
4281
|
"type": "SYMBOL",
|
|
3957
4282
|
"name": "array_repeat"
|
|
3958
4283
|
},
|
|
4284
|
+
{
|
|
4285
|
+
"type": "SYMBOL",
|
|
4286
|
+
"name": "map_literal"
|
|
4287
|
+
},
|
|
3959
4288
|
{
|
|
3960
4289
|
"type": "SYMBOL",
|
|
3961
4290
|
"name": "tuple_expression"
|
|
@@ -4845,6 +5174,81 @@
|
|
|
4845
5174
|
}
|
|
4846
5175
|
]
|
|
4847
5176
|
},
|
|
5177
|
+
"map_literal": {
|
|
5178
|
+
"type": "SEQ",
|
|
5179
|
+
"members": [
|
|
5180
|
+
{
|
|
5181
|
+
"type": "STRING",
|
|
5182
|
+
"value": "{"
|
|
5183
|
+
},
|
|
5184
|
+
{
|
|
5185
|
+
"type": "SEQ",
|
|
5186
|
+
"members": [
|
|
5187
|
+
{
|
|
5188
|
+
"type": "SYMBOL",
|
|
5189
|
+
"name": "map_entry"
|
|
5190
|
+
},
|
|
5191
|
+
{
|
|
5192
|
+
"type": "REPEAT",
|
|
5193
|
+
"content": {
|
|
5194
|
+
"type": "SEQ",
|
|
5195
|
+
"members": [
|
|
5196
|
+
{
|
|
5197
|
+
"type": "STRING",
|
|
5198
|
+
"value": ","
|
|
5199
|
+
},
|
|
5200
|
+
{
|
|
5201
|
+
"type": "SYMBOL",
|
|
5202
|
+
"name": "map_entry"
|
|
5203
|
+
}
|
|
5204
|
+
]
|
|
5205
|
+
}
|
|
5206
|
+
}
|
|
5207
|
+
]
|
|
5208
|
+
},
|
|
5209
|
+
{
|
|
5210
|
+
"type": "CHOICE",
|
|
5211
|
+
"members": [
|
|
5212
|
+
{
|
|
5213
|
+
"type": "STRING",
|
|
5214
|
+
"value": ","
|
|
5215
|
+
},
|
|
5216
|
+
{
|
|
5217
|
+
"type": "BLANK"
|
|
5218
|
+
}
|
|
5219
|
+
]
|
|
5220
|
+
},
|
|
5221
|
+
{
|
|
5222
|
+
"type": "STRING",
|
|
5223
|
+
"value": "}"
|
|
5224
|
+
}
|
|
5225
|
+
]
|
|
5226
|
+
},
|
|
5227
|
+
"map_entry": {
|
|
5228
|
+
"type": "SEQ",
|
|
5229
|
+
"members": [
|
|
5230
|
+
{
|
|
5231
|
+
"type": "FIELD",
|
|
5232
|
+
"name": "key",
|
|
5233
|
+
"content": {
|
|
5234
|
+
"type": "SYMBOL",
|
|
5235
|
+
"name": "expression"
|
|
5236
|
+
}
|
|
5237
|
+
},
|
|
5238
|
+
{
|
|
5239
|
+
"type": "STRING",
|
|
5240
|
+
"value": ":"
|
|
5241
|
+
},
|
|
5242
|
+
{
|
|
5243
|
+
"type": "FIELD",
|
|
5244
|
+
"name": "value",
|
|
5245
|
+
"content": {
|
|
5246
|
+
"type": "SYMBOL",
|
|
5247
|
+
"name": "expression"
|
|
5248
|
+
}
|
|
5249
|
+
}
|
|
5250
|
+
]
|
|
5251
|
+
},
|
|
4848
5252
|
"tuple_expression": {
|
|
4849
5253
|
"type": "SEQ",
|
|
4850
5254
|
"members": [
|
|
@@ -5189,10 +5593,6 @@
|
|
|
5189
5593
|
}
|
|
5190
5594
|
]
|
|
5191
5595
|
},
|
|
5192
|
-
{
|
|
5193
|
-
"type": "STRING",
|
|
5194
|
-
"value": "("
|
|
5195
|
-
},
|
|
5196
5596
|
{
|
|
5197
5597
|
"type": "CHOICE",
|
|
5198
5598
|
"members": [
|
|
@@ -5200,24 +5600,45 @@
|
|
|
5200
5600
|
"type": "SEQ",
|
|
5201
5601
|
"members": [
|
|
5202
5602
|
{
|
|
5203
|
-
"type": "
|
|
5204
|
-
"
|
|
5603
|
+
"type": "STRING",
|
|
5604
|
+
"value": "("
|
|
5205
5605
|
},
|
|
5206
5606
|
{
|
|
5207
|
-
"type": "
|
|
5208
|
-
"
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5607
|
+
"type": "CHOICE",
|
|
5608
|
+
"members": [
|
|
5609
|
+
{
|
|
5610
|
+
"type": "SEQ",
|
|
5611
|
+
"members": [
|
|
5612
|
+
{
|
|
5613
|
+
"type": "SYMBOL",
|
|
5614
|
+
"name": "call_argument"
|
|
5615
|
+
},
|
|
5616
|
+
{
|
|
5617
|
+
"type": "REPEAT",
|
|
5618
|
+
"content": {
|
|
5619
|
+
"type": "SEQ",
|
|
5620
|
+
"members": [
|
|
5621
|
+
{
|
|
5622
|
+
"type": "STRING",
|
|
5623
|
+
"value": ","
|
|
5624
|
+
},
|
|
5625
|
+
{
|
|
5626
|
+
"type": "SYMBOL",
|
|
5627
|
+
"name": "call_argument"
|
|
5628
|
+
}
|
|
5629
|
+
]
|
|
5630
|
+
}
|
|
5631
|
+
}
|
|
5632
|
+
]
|
|
5633
|
+
},
|
|
5634
|
+
{
|
|
5635
|
+
"type": "BLANK"
|
|
5636
|
+
}
|
|
5637
|
+
]
|
|
5638
|
+
},
|
|
5639
|
+
{
|
|
5640
|
+
"type": "STRING",
|
|
5641
|
+
"value": ")"
|
|
5221
5642
|
}
|
|
5222
5643
|
]
|
|
5223
5644
|
},
|
|
@@ -5225,10 +5646,6 @@
|
|
|
5225
5646
|
"type": "BLANK"
|
|
5226
5647
|
}
|
|
5227
5648
|
]
|
|
5228
|
-
},
|
|
5229
|
-
{
|
|
5230
|
-
"type": "STRING",
|
|
5231
|
-
"value": ")"
|
|
5232
5649
|
}
|
|
5233
5650
|
]
|
|
5234
5651
|
},
|
|
@@ -6002,6 +6419,10 @@
|
|
|
6002
6419
|
"type": "SYMBOL",
|
|
6003
6420
|
"name": "raw_string_literal"
|
|
6004
6421
|
},
|
|
6422
|
+
{
|
|
6423
|
+
"type": "SYMBOL",
|
|
6424
|
+
"name": "byte_string_literal"
|
|
6425
|
+
},
|
|
6005
6426
|
{
|
|
6006
6427
|
"type": "SYMBOL",
|
|
6007
6428
|
"name": "regex_literal"
|
|
@@ -6212,6 +6633,26 @@
|
|
|
6212
6633
|
]
|
|
6213
6634
|
}
|
|
6214
6635
|
},
|
|
6636
|
+
"byte_string_literal": {
|
|
6637
|
+
"type": "TOKEN",
|
|
6638
|
+
"content": {
|
|
6639
|
+
"type": "SEQ",
|
|
6640
|
+
"members": [
|
|
6641
|
+
{
|
|
6642
|
+
"type": "STRING",
|
|
6643
|
+
"value": "b\""
|
|
6644
|
+
},
|
|
6645
|
+
{
|
|
6646
|
+
"type": "PATTERN",
|
|
6647
|
+
"value": "([^\"\\\\]|\\\\.)*"
|
|
6648
|
+
},
|
|
6649
|
+
{
|
|
6650
|
+
"type": "STRING",
|
|
6651
|
+
"value": "\""
|
|
6652
|
+
}
|
|
6653
|
+
]
|
|
6654
|
+
}
|
|
6655
|
+
},
|
|
6215
6656
|
"regex_literal": {
|
|
6216
6657
|
"type": "TOKEN",
|
|
6217
6658
|
"content": {
|
|
@@ -6324,6 +6765,9 @@
|
|
|
6324
6765
|
[
|
|
6325
6766
|
"expression",
|
|
6326
6767
|
"struct_init"
|
|
6768
|
+
],
|
|
6769
|
+
[
|
|
6770
|
+
"actor_spawn"
|
|
6327
6771
|
]
|
|
6328
6772
|
],
|
|
6329
6773
|
"precedences": [],
|