tree-sitter-abl 0.1.0 → 0.1.1

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 CHANGED
@@ -48,7 +48,7 @@ module.exports = grammar({
48
48
  [$.include, $.constant],
49
49
  [$.include_argument],
50
50
  [$.include_argument, $._constant_value],
51
- [$._literal, $._expression]
51
+ [$._literal, $._expression],
52
52
  ],
53
53
 
54
54
  rules: {
@@ -577,8 +577,8 @@ module.exports = grammar({
577
577
  seq(kw("MAP"), $.identifier),
578
578
  seq(
579
579
  kw("CONVERT"),
580
- optional(seq(kw("TARGET"), $.string_literal)),
581
- optional(seq(kw("SOURCE"), $.string_literal))
580
+ optional(seq(kw("TARGET"), choice($.identifier, $.string_literal))),
581
+ optional(seq(kw("SOURCE"), choice($.identifier, $.string_literal)))
582
582
  ),
583
583
  ),
584
584
 
@@ -1025,7 +1025,8 @@ module.exports = grammar({
1025
1025
  seq(
1026
1026
  $.assignment,
1027
1027
  kw("TO"),
1028
- choice($.function_call, $._integer_literal, $._name, $.object_access),
1028
+ optional(choice(kw("BROWSE"), kw("SELECTION-LIST"), kw("LIST-BOX"))),
1029
+ choice($.function_call, $._integer_literal, $._name, $.object_access, $.multiplicative_expression, $.additive_expression),
1029
1030
  optional(seq(kw("BY"), choice($._integer_literal, $.unary_expression)))
1030
1031
  ),
1031
1032
 
@@ -1871,7 +1872,7 @@ module.exports = grammar({
1871
1872
  $._block_terminator
1872
1873
  ),
1873
1874
 
1874
- variable_assignment: ($) => seq($.assignment, $._terminator),
1875
+ variable_assignment: ($) => seq($.assignment, optional(kw("NO-ERROR")), $._terminator),
1875
1876
 
1876
1877
  assignment: ($) =>
1877
1878
  prec.right(
@@ -1928,7 +1929,7 @@ module.exports = grammar({
1928
1929
  repeat($._repeat_phrase),
1929
1930
  optional($.preselect_phrase),
1930
1931
  optional($.while_phrase),
1931
- optional($._on_phrase),
1932
+ repeat($._on_phrase),
1932
1933
  $.body,
1933
1934
  $._block_terminator
1934
1935
  ),
@@ -1941,11 +1942,11 @@ module.exports = grammar({
1941
1942
  ),
1942
1943
 
1943
1944
  return_statement: ($) =>
1944
- seq(
1945
+ prec(1, seq(
1945
1946
  alias($._return_keyword, "RETURN"),
1946
1947
  optional($._return_action),
1947
1948
  $._terminator
1948
- ),
1949
+ )),
1949
1950
 
1950
1951
  input_output_statement: ($) =>
1951
1952
  seq(
@@ -1957,8 +1958,8 @@ module.exports = grammar({
1957
1958
  ),
1958
1959
  ),
1959
1960
  $._input_output_option,
1960
- repeat($.stream_tuning),
1961
1961
  repeat($.stream_flag),
1962
+ repeat($.stream_tuning),
1962
1963
  optional($.constant),
1963
1964
  $._terminator
1964
1965
  ),
@@ -1969,6 +1970,19 @@ module.exports = grammar({
1969
1970
  seq(
1970
1971
  choice(kw("FROM"), kw("TO")),
1971
1972
  choice($.string_literal, $.function_call)
1973
+ ),
1974
+ seq(
1975
+ kw("THROUGH"),
1976
+ choice($.identifier, seq(kw("VALUE"), "(", $._expression, ")")),
1977
+ repeat(
1978
+ choice(
1979
+ $.identifier,
1980
+ $.string_literal,
1981
+ $.number_literal,
1982
+ seq(kw("VALUE"), "(", $._expression, ")")
1983
+ )
1984
+ ),
1985
+ optional(seq(">", $.identifier))
1972
1986
  )
1973
1987
  ),
1974
1988
 
@@ -2109,6 +2123,7 @@ module.exports = grammar({
2109
2123
  "procedure",
2110
2124
  choice($._name, $.function_call, $.file_name, $.string_literal)
2111
2125
  ),
2126
+ optional($.function_call_argument),
2112
2127
  repeat($.run_tuning),
2113
2128
  optional(alias($.function_arguments, $.arguments)),
2114
2129
  optional(kw("NO-ERROR")),
@@ -2129,7 +2144,7 @@ module.exports = grammar({
2129
2144
  optional($.label),
2130
2145
  kw("DO"),
2131
2146
  repeat($._do_tuning),
2132
- optional($._on_phrase),
2147
+ repeat($._on_phrase),
2133
2148
  optional($.frame_phrase),
2134
2149
  $.body,
2135
2150
  $._block_terminator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-abl",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "ABL grammar for tree-sitter",
5
5
  "repository": "https://github.com/eglekaz/tree-sitter-abl",
6
6
  "keywords": [
package/parser.exp CHANGED
Binary file
package/parser.lib CHANGED
Binary file
package/parser.obj CHANGED
Binary file
package/scanner.obj CHANGED
Binary file
package/src/grammar.json CHANGED
@@ -3507,8 +3507,17 @@
3507
3507
  "value": "TARGET"
3508
3508
  },
3509
3509
  {
3510
- "type": "SYMBOL",
3511
- "name": "string_literal"
3510
+ "type": "CHOICE",
3511
+ "members": [
3512
+ {
3513
+ "type": "SYMBOL",
3514
+ "name": "identifier"
3515
+ },
3516
+ {
3517
+ "type": "SYMBOL",
3518
+ "name": "string_literal"
3519
+ }
3520
+ ]
3512
3521
  }
3513
3522
  ]
3514
3523
  },
@@ -3540,8 +3549,17 @@
3540
3549
  "value": "SOURCE"
3541
3550
  },
3542
3551
  {
3543
- "type": "SYMBOL",
3544
- "name": "string_literal"
3552
+ "type": "CHOICE",
3553
+ "members": [
3554
+ {
3555
+ "type": "SYMBOL",
3556
+ "name": "identifier"
3557
+ },
3558
+ {
3559
+ "type": "SYMBOL",
3560
+ "name": "string_literal"
3561
+ }
3562
+ ]
3545
3563
  }
3546
3564
  ]
3547
3565
  },
@@ -7310,6 +7328,67 @@
7310
7328
  "named": false,
7311
7329
  "value": "TO"
7312
7330
  },
7331
+ {
7332
+ "type": "CHOICE",
7333
+ "members": [
7334
+ {
7335
+ "type": "CHOICE",
7336
+ "members": [
7337
+ {
7338
+ "type": "ALIAS",
7339
+ "content": {
7340
+ "type": "TOKEN",
7341
+ "content": {
7342
+ "type": "PREC",
7343
+ "value": 1,
7344
+ "content": {
7345
+ "type": "PATTERN",
7346
+ "value": "[bB][rR][oO][wW][sS][eE]"
7347
+ }
7348
+ }
7349
+ },
7350
+ "named": false,
7351
+ "value": "BROWSE"
7352
+ },
7353
+ {
7354
+ "type": "ALIAS",
7355
+ "content": {
7356
+ "type": "TOKEN",
7357
+ "content": {
7358
+ "type": "PREC",
7359
+ "value": 1,
7360
+ "content": {
7361
+ "type": "PATTERN",
7362
+ "value": "[sS][eE][lL][eE][cC][tT][iI][oO][nN][--][lL][iI][sS][tT]"
7363
+ }
7364
+ }
7365
+ },
7366
+ "named": false,
7367
+ "value": "SELECTION-LIST"
7368
+ },
7369
+ {
7370
+ "type": "ALIAS",
7371
+ "content": {
7372
+ "type": "TOKEN",
7373
+ "content": {
7374
+ "type": "PREC",
7375
+ "value": 1,
7376
+ "content": {
7377
+ "type": "PATTERN",
7378
+ "value": "[lL][iI][sS][tT][--][bB][oO][xX]"
7379
+ }
7380
+ }
7381
+ },
7382
+ "named": false,
7383
+ "value": "LIST-BOX"
7384
+ }
7385
+ ]
7386
+ },
7387
+ {
7388
+ "type": "BLANK"
7389
+ }
7390
+ ]
7391
+ },
7313
7392
  {
7314
7393
  "type": "CHOICE",
7315
7394
  "members": [
@@ -7328,6 +7407,14 @@
7328
7407
  {
7329
7408
  "type": "SYMBOL",
7330
7409
  "name": "object_access"
7410
+ },
7411
+ {
7412
+ "type": "SYMBOL",
7413
+ "name": "multiplicative_expression"
7414
+ },
7415
+ {
7416
+ "type": "SYMBOL",
7417
+ "name": "additive_expression"
7331
7418
  }
7332
7419
  ]
7333
7420
  },
@@ -13327,6 +13414,30 @@
13327
13414
  "type": "SYMBOL",
13328
13415
  "name": "assignment"
13329
13416
  },
13417
+ {
13418
+ "type": "CHOICE",
13419
+ "members": [
13420
+ {
13421
+ "type": "ALIAS",
13422
+ "content": {
13423
+ "type": "TOKEN",
13424
+ "content": {
13425
+ "type": "PREC",
13426
+ "value": 1,
13427
+ "content": {
13428
+ "type": "PATTERN",
13429
+ "value": "[nN][oO][--][eE][rR][rR][oO][rR]"
13430
+ }
13431
+ }
13432
+ },
13433
+ "named": false,
13434
+ "value": "NO-ERROR"
13435
+ },
13436
+ {
13437
+ "type": "BLANK"
13438
+ }
13439
+ ]
13440
+ },
13330
13441
  {
13331
13442
  "type": "SYMBOL",
13332
13443
  "name": "_terminator"
@@ -13677,16 +13788,11 @@
13677
13788
  ]
13678
13789
  },
13679
13790
  {
13680
- "type": "CHOICE",
13681
- "members": [
13682
- {
13683
- "type": "SYMBOL",
13684
- "name": "_on_phrase"
13685
- },
13686
- {
13687
- "type": "BLANK"
13688
- }
13689
- ]
13791
+ "type": "REPEAT",
13792
+ "content": {
13793
+ "type": "SYMBOL",
13794
+ "name": "_on_phrase"
13795
+ }
13690
13796
  },
13691
13797
  {
13692
13798
  "type": "SYMBOL",
@@ -13712,34 +13818,38 @@
13712
13818
  ]
13713
13819
  },
13714
13820
  "return_statement": {
13715
- "type": "SEQ",
13716
- "members": [
13717
- {
13718
- "type": "ALIAS",
13719
- "content": {
13720
- "type": "SYMBOL",
13721
- "name": "_return_keyword"
13722
- },
13723
- "named": false,
13724
- "value": "RETURN"
13725
- },
13726
- {
13727
- "type": "CHOICE",
13728
- "members": [
13729
- {
13821
+ "type": "PREC",
13822
+ "value": 1,
13823
+ "content": {
13824
+ "type": "SEQ",
13825
+ "members": [
13826
+ {
13827
+ "type": "ALIAS",
13828
+ "content": {
13730
13829
  "type": "SYMBOL",
13731
- "name": "_return_action"
13830
+ "name": "_return_keyword"
13732
13831
  },
13733
- {
13734
- "type": "BLANK"
13735
- }
13736
- ]
13737
- },
13738
- {
13739
- "type": "SYMBOL",
13740
- "name": "_terminator"
13741
- }
13742
- ]
13832
+ "named": false,
13833
+ "value": "RETURN"
13834
+ },
13835
+ {
13836
+ "type": "CHOICE",
13837
+ "members": [
13838
+ {
13839
+ "type": "SYMBOL",
13840
+ "name": "_return_action"
13841
+ },
13842
+ {
13843
+ "type": "BLANK"
13844
+ }
13845
+ ]
13846
+ },
13847
+ {
13848
+ "type": "SYMBOL",
13849
+ "name": "_terminator"
13850
+ }
13851
+ ]
13852
+ }
13743
13853
  },
13744
13854
  "input_output_statement": {
13745
13855
  "type": "SEQ",
@@ -13833,14 +13943,14 @@
13833
13943
  "type": "REPEAT",
13834
13944
  "content": {
13835
13945
  "type": "SYMBOL",
13836
- "name": "stream_tuning"
13946
+ "name": "stream_flag"
13837
13947
  }
13838
13948
  },
13839
13949
  {
13840
13950
  "type": "REPEAT",
13841
13951
  "content": {
13842
13952
  "type": "SYMBOL",
13843
- "name": "stream_flag"
13953
+ "name": "stream_tuning"
13844
13954
  }
13845
13955
  },
13846
13956
  {
@@ -13934,6 +14044,143 @@
13934
14044
  ]
13935
14045
  }
13936
14046
  ]
14047
+ },
14048
+ {
14049
+ "type": "SEQ",
14050
+ "members": [
14051
+ {
14052
+ "type": "ALIAS",
14053
+ "content": {
14054
+ "type": "TOKEN",
14055
+ "content": {
14056
+ "type": "PREC",
14057
+ "value": 1,
14058
+ "content": {
14059
+ "type": "PATTERN",
14060
+ "value": "[tT][hH][rR][oO][uU][gG][hH]"
14061
+ }
14062
+ }
14063
+ },
14064
+ "named": false,
14065
+ "value": "THROUGH"
14066
+ },
14067
+ {
14068
+ "type": "CHOICE",
14069
+ "members": [
14070
+ {
14071
+ "type": "SYMBOL",
14072
+ "name": "identifier"
14073
+ },
14074
+ {
14075
+ "type": "SEQ",
14076
+ "members": [
14077
+ {
14078
+ "type": "ALIAS",
14079
+ "content": {
14080
+ "type": "TOKEN",
14081
+ "content": {
14082
+ "type": "PREC",
14083
+ "value": 1,
14084
+ "content": {
14085
+ "type": "PATTERN",
14086
+ "value": "[vV][aA][lL][uU][eE]"
14087
+ }
14088
+ }
14089
+ },
14090
+ "named": false,
14091
+ "value": "VALUE"
14092
+ },
14093
+ {
14094
+ "type": "STRING",
14095
+ "value": "("
14096
+ },
14097
+ {
14098
+ "type": "SYMBOL",
14099
+ "name": "_expression"
14100
+ },
14101
+ {
14102
+ "type": "STRING",
14103
+ "value": ")"
14104
+ }
14105
+ ]
14106
+ }
14107
+ ]
14108
+ },
14109
+ {
14110
+ "type": "REPEAT",
14111
+ "content": {
14112
+ "type": "CHOICE",
14113
+ "members": [
14114
+ {
14115
+ "type": "SYMBOL",
14116
+ "name": "identifier"
14117
+ },
14118
+ {
14119
+ "type": "SYMBOL",
14120
+ "name": "string_literal"
14121
+ },
14122
+ {
14123
+ "type": "SYMBOL",
14124
+ "name": "number_literal"
14125
+ },
14126
+ {
14127
+ "type": "SEQ",
14128
+ "members": [
14129
+ {
14130
+ "type": "ALIAS",
14131
+ "content": {
14132
+ "type": "TOKEN",
14133
+ "content": {
14134
+ "type": "PREC",
14135
+ "value": 1,
14136
+ "content": {
14137
+ "type": "PATTERN",
14138
+ "value": "[vV][aA][lL][uU][eE]"
14139
+ }
14140
+ }
14141
+ },
14142
+ "named": false,
14143
+ "value": "VALUE"
14144
+ },
14145
+ {
14146
+ "type": "STRING",
14147
+ "value": "("
14148
+ },
14149
+ {
14150
+ "type": "SYMBOL",
14151
+ "name": "_expression"
14152
+ },
14153
+ {
14154
+ "type": "STRING",
14155
+ "value": ")"
14156
+ }
14157
+ ]
14158
+ }
14159
+ ]
14160
+ }
14161
+ },
14162
+ {
14163
+ "type": "CHOICE",
14164
+ "members": [
14165
+ {
14166
+ "type": "SEQ",
14167
+ "members": [
14168
+ {
14169
+ "type": "STRING",
14170
+ "value": ">"
14171
+ },
14172
+ {
14173
+ "type": "SYMBOL",
14174
+ "name": "identifier"
14175
+ }
14176
+ ]
14177
+ },
14178
+ {
14179
+ "type": "BLANK"
14180
+ }
14181
+ ]
14182
+ }
14183
+ ]
13937
14184
  }
13938
14185
  ]
13939
14186
  },
@@ -14826,6 +15073,18 @@
14826
15073
  ]
14827
15074
  }
14828
15075
  },
15076
+ {
15077
+ "type": "CHOICE",
15078
+ "members": [
15079
+ {
15080
+ "type": "SYMBOL",
15081
+ "name": "function_call_argument"
15082
+ },
15083
+ {
15084
+ "type": "BLANK"
15085
+ }
15086
+ ]
15087
+ },
14829
15088
  {
14830
15089
  "type": "REPEAT",
14831
15090
  "content": {
@@ -14985,16 +15244,11 @@
14985
15244
  }
14986
15245
  },
14987
15246
  {
14988
- "type": "CHOICE",
14989
- "members": [
14990
- {
14991
- "type": "SYMBOL",
14992
- "name": "_on_phrase"
14993
- },
14994
- {
14995
- "type": "BLANK"
14996
- }
14997
- ]
15247
+ "type": "REPEAT",
15248
+ "content": {
15249
+ "type": "SYMBOL",
15250
+ "name": "_on_phrase"
15251
+ }
14998
15252
  },
14999
15253
  {
15000
15254
  "type": "CHOICE",