@surrealdb/lezer 1.0.4 → 1.0.5

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.
@@ -217,172 +217,173 @@ export const
217
217
  LiveSelectStatement = 210,
218
218
  Predicate = 211,
219
219
  prefixedString = 212,
220
- FormatString = 213,
221
- Interpolation = 216,
222
- Int = 217,
223
- Float = 218,
224
- Decimal = 219,
225
- Regex = 220,
226
- VariableName = 221,
227
- Array = 225,
228
- Set = 226,
229
- RecordId = 227,
230
- RecordTbIdent = 228,
231
- RecordIdIdent = 230,
232
- Object = 231,
233
- ObjectContent = 232,
234
- ObjectProperty = 233,
235
- ObjectKey = 234,
236
- RecordIdRange = 237,
237
- FunctionJs = 238,
238
- ArgumentList = 240,
239
- IfElseStatement = 241,
240
- Block = 243,
241
- SubQuery = 244,
242
- LetStatement = 246,
243
- paramDefinition = 247,
244
- LiteralType = 253,
245
- Duration = 254,
246
- DurationPart = 255,
247
- ObjectTypeContent = 258,
248
- ObjectTypeProperty = 259,
249
- DeleteStatement = 262,
250
- WhereClause = 263,
251
- ReturnClause = 264,
252
- Fields = 265,
253
- AnyStar = 266,
254
- TimeoutClause = 267,
255
- ParallelClause = 268,
256
- CreateStatement = 269,
257
- FunctionCall = 270,
258
- FunctionName = 271,
259
- customFunctionName = 272,
260
- VersionNumber = 274,
261
- ContentClause = 275,
262
- SetClause = 276,
263
- FieldAssignment = 277,
264
- assignmentOperator = 278,
265
- UnsetClause = 279,
266
- SelectStatement = 280,
267
- OmitClause = 281,
268
- WithClause = 282,
269
- SplitClause = 283,
270
- Idiom = 284,
271
- GroupClause = 285,
272
- OrderClause = 286,
273
- Order = 287,
274
- LimitStartComboClause = 288,
275
- StartClause = 289,
276
- LimitClause = 290,
277
- FetchClause = 291,
278
- Path = 292,
279
- Lookup = 293,
280
- Any = 298,
281
- LookupSelection = 299,
282
- GraphPredicate = 301,
283
- Optional = 307,
284
- At = 308,
285
- IdiomFunction = 309,
286
- Destructure = 311,
287
- Recurse = 312,
288
- RecurseRange = 313,
289
- RecurseOptions = 314,
290
- recurseOptionName = 315,
291
- TempfilesClause = 318,
292
- ExplainClause = 319,
293
- VersionClause = 320,
294
- RelateStatement = 321,
295
- UpdateStatement = 322,
296
- MergeClause = 323,
297
- PatchClause = 324,
298
- ReplaceClause = 325,
299
- RemoveStatement = 326,
300
- IfExistsClause = 327,
301
- OnTableClause = 328,
302
- functionKw = 329,
303
- UpsertStatement = 330,
304
- ReturnStatement = 331,
305
- AlterStatement = 332,
306
- IfNotExistsClause = 333,
307
- PermissionsForClause = 334,
308
- PermissionGroup = 335,
309
- CommentClause = 336,
310
- DefineStatement = 337,
311
- OverwriteClause = 339,
312
- OnRootNsDbClause = 340,
313
- AccessTypeClause = 341,
314
- JwtClause = 342,
315
- SignupClause = 343,
316
- SigninClause = 344,
317
- AuthenticateClause = 345,
318
- DurationClause = 346,
319
- DurationValue = 347,
320
- TokenTypeClause = 348,
321
- TypeClause = 351,
322
- DefaultClause = 352,
323
- ReadonlyClause = 354,
324
- ValueClause = 355,
325
- AssertClause = 356,
326
- ReferenceClause = 357,
327
- ComputedClause = 358,
328
- FieldsColumnsClause = 359,
329
- IndexClause = 360,
330
- UniqueClause = 361,
331
- SearchAnalyzerClause = 362,
332
- Bm25Clause = 363,
333
- DocIdsOrderClause = 364,
334
- DocLenghtsOrderClause = 365,
335
- PostingsOrderClause = 366,
336
- TermsOrderClause = 367,
337
- DocIdsCacheClause = 368,
338
- DocLenghtsCacheClause = 369,
339
- PostingsCacheClause = 370,
340
- TermsCacheClause = 371,
341
- MtreeClause = 372,
342
- IndexDimensionClause = 373,
343
- MtreeDistClause = 374,
344
- IndexCapacityClause = 375,
345
- MtreeCacheClause = 376,
346
- HnswClause = 377,
347
- HnswDistClause = 378,
348
- IndexLmClause = 379,
349
- IndexM0Clause = 380,
350
- IndexMClause = 381,
351
- IndexEfcClause = 382,
352
- IndexExtendCandidatesClause = 383,
353
- IndexKeepPrunedConnectionsClause = 384,
354
- TokenizersClause = 387,
355
- FiltersClause = 388,
356
- AnalyzerFilters = 389,
357
- FunctionClause = 390,
358
- PermissionsBasicClause = 391,
359
- SessionClause = 393,
360
- TableTypeClause = 394,
361
- TableViewClause = 396,
362
- ChangefeedClause = 397,
363
- ApiOptions = 398,
364
- MiddlewareClause = 399,
365
- HttpMethod = 400,
366
- BackendClause = 401,
367
- RebuildStatement = 402,
368
- InsertStatement = 403,
369
- JavaScriptBlock = 405,
370
- Closure = 407,
371
- escapedParamDefinition = 408,
372
- TypeCast = 410,
373
- BinaryExpression = 412,
374
- Operator = 413,
375
- Range = 414,
376
- ShowStatement = 415,
377
- SleepStatement = 416,
378
- UseStatement = 417,
379
- OptionStatement = 418,
380
- BreakStatement = 419,
381
- ContinueStatement = 420,
382
- ForStatement = 421,
383
- ThrowStatement = 422,
384
- PermissionInput = 423,
385
- IndexInput = 424,
386
- CombinedResults = 425,
387
- CommentResult = 427,
388
- Syntax = 429
220
+ Number = 213,
221
+ Int = 214,
222
+ Float = 215,
223
+ Decimal = 216,
224
+ Array = 219,
225
+ Set = 222,
226
+ RecordId = 223,
227
+ RecordTbIdent = 224,
228
+ RecordIdIdent = 226,
229
+ Object = 227,
230
+ ObjectContent = 228,
231
+ ObjectProperty = 229,
232
+ ObjectKey = 230,
233
+ RecordIdRange = 233,
234
+ Duration = 234,
235
+ DurationPart = 235,
236
+ FormatString = 237,
237
+ Interpolation = 238,
238
+ Regex = 239,
239
+ VariableName = 240,
240
+ FunctionJs = 242,
241
+ ArgumentList = 244,
242
+ IfElseStatement = 245,
243
+ Block = 247,
244
+ SubQuery = 248,
245
+ LetStatement = 250,
246
+ paramDefinition = 251,
247
+ LiteralType = 257,
248
+ ObjectTypeContent = 260,
249
+ ObjectTypeProperty = 261,
250
+ DeleteStatement = 264,
251
+ WhereClause = 265,
252
+ ReturnClause = 266,
253
+ Fields = 267,
254
+ AnyStar = 268,
255
+ TimeoutClause = 269,
256
+ ParallelClause = 270,
257
+ CreateStatement = 271,
258
+ FunctionCall = 272,
259
+ FunctionName = 273,
260
+ customFunctionName = 274,
261
+ VersionNumber = 276,
262
+ ContentClause = 277,
263
+ SetClause = 278,
264
+ FieldAssignment = 279,
265
+ assignmentOperator = 280,
266
+ UnsetClause = 281,
267
+ SelectStatement = 282,
268
+ OmitClause = 283,
269
+ WithClause = 284,
270
+ SplitClause = 285,
271
+ Idiom = 286,
272
+ GroupClause = 287,
273
+ OrderClause = 288,
274
+ Order = 289,
275
+ LimitStartComboClause = 290,
276
+ StartClause = 291,
277
+ LimitClause = 292,
278
+ FetchClause = 293,
279
+ TempfilesClause = 294,
280
+ ExplainClause = 295,
281
+ VersionClause = 296,
282
+ RelateStatement = 297,
283
+ UpdateStatement = 300,
284
+ MergeClause = 301,
285
+ PatchClause = 302,
286
+ ReplaceClause = 303,
287
+ RemoveStatement = 304,
288
+ IfExistsClause = 305,
289
+ OnTableClause = 306,
290
+ functionKw = 307,
291
+ UpsertStatement = 308,
292
+ ReturnStatement = 309,
293
+ AlterStatement = 310,
294
+ IfNotExistsClause = 311,
295
+ PermissionsForClause = 312,
296
+ PermissionGroup = 313,
297
+ CommentClause = 314,
298
+ DefineStatement = 315,
299
+ OverwriteClause = 317,
300
+ OnRootNsDbClause = 318,
301
+ AccessTypeClause = 319,
302
+ JwtClause = 320,
303
+ SignupClause = 321,
304
+ SigninClause = 322,
305
+ AuthenticateClause = 323,
306
+ DurationClause = 324,
307
+ DurationValue = 325,
308
+ TokenTypeClause = 326,
309
+ TypeClause = 329,
310
+ DefaultClause = 330,
311
+ ReadonlyClause = 332,
312
+ ValueClause = 333,
313
+ AssertClause = 334,
314
+ ReferenceClause = 335,
315
+ ComputedClause = 336,
316
+ FieldsColumnsClause = 337,
317
+ IndexClause = 338,
318
+ UniqueClause = 339,
319
+ SearchAnalyzerClause = 340,
320
+ Bm25Clause = 341,
321
+ DocIdsOrderClause = 342,
322
+ DocLenghtsOrderClause = 343,
323
+ PostingsOrderClause = 344,
324
+ TermsOrderClause = 345,
325
+ DocIdsCacheClause = 346,
326
+ DocLenghtsCacheClause = 347,
327
+ PostingsCacheClause = 348,
328
+ TermsCacheClause = 349,
329
+ MtreeClause = 350,
330
+ IndexDimensionClause = 351,
331
+ MtreeDistClause = 352,
332
+ IndexCapacityClause = 353,
333
+ MtreeCacheClause = 354,
334
+ HnswClause = 355,
335
+ HnswDistClause = 356,
336
+ IndexLmClause = 357,
337
+ IndexM0Clause = 358,
338
+ IndexMClause = 359,
339
+ IndexEfcClause = 360,
340
+ IndexExtendCandidatesClause = 361,
341
+ IndexKeepPrunedConnectionsClause = 362,
342
+ TokenizersClause = 365,
343
+ FiltersClause = 366,
344
+ AnalyzerFilters = 367,
345
+ FunctionClause = 368,
346
+ PermissionsBasicClause = 369,
347
+ SessionClause = 371,
348
+ TableTypeClause = 372,
349
+ TableViewClause = 374,
350
+ ChangefeedClause = 375,
351
+ ApiOptions = 376,
352
+ MiddlewareClause = 377,
353
+ HttpMethod = 378,
354
+ BackendClause = 379,
355
+ RebuildStatement = 380,
356
+ InsertStatement = 381,
357
+ JavaScriptBlock = 383,
358
+ Closure = 385,
359
+ escapedParamDefinition = 386,
360
+ TypeCast = 388,
361
+ BinaryExpression = 389,
362
+ Operator = 390,
363
+ Range = 391,
364
+ Path = 392,
365
+ Lookup = 393,
366
+ Any = 396,
367
+ LookupSelection = 397,
368
+ GraphPredicate = 399,
369
+ Optional = 405,
370
+ At = 406,
371
+ IdiomFunction = 407,
372
+ Destructure = 409,
373
+ Recurse = 410,
374
+ RecurseRange = 411,
375
+ RecurseOptions = 412,
376
+ recurseOptionName = 413,
377
+ ShowStatement = 416,
378
+ SleepStatement = 417,
379
+ UseStatement = 418,
380
+ OptionStatement = 419,
381
+ BreakStatement = 420,
382
+ ContinueStatement = 421,
383
+ ForStatement = 422,
384
+ ThrowStatement = 423,
385
+ PermissionInput = 424,
386
+ IndexInput = 425,
387
+ CombinedResults = 426,
388
+ CommentResult = 428,
389
+ Syntax = 430
@@ -778,7 +778,7 @@ ShowStatement {
778
778
  show changes for table
779
779
  Ident
780
780
  ( since String )?
781
- ( limit number )?
781
+ ( limit Number )?
782
782
  }
783
783
 
784
784
  // Sleep statement
@@ -816,30 +816,34 @@ RebuildStatement[since=1_5_0] {
816
816
 
817
817
  // Values
818
818
 
819
- baseValue {
819
+ computedValue[@isGroup=Value] {
820
820
  String |
821
821
  prefixedString |
822
- FormatString |
823
- number |
822
+ Number |
824
823
  true |
825
824
  false |
826
825
  null |
827
826
  none |
828
- Regex |
829
- VariableName |
830
- Ident[@dynamicPrecedence=-1] { rawident } |
831
827
  Array |
832
828
  Set |
833
829
  RecordId |
830
+ Object |
831
+ Duration |
832
+ Point { "(" Number "," Number ")" }
833
+ }
834
+
835
+ baseValue[@isGroup=Value] {
836
+ computedValue |
837
+ FormatString |
838
+ Regex |
839
+ VariableName |
840
+ Ident[@dynamicPrecedence=-1] { rawident } |
834
841
  FunctionJs |
835
842
  FunctionCall |
836
843
  SubQuery |
837
844
  Block |
838
845
  Closure |
839
- Object |
840
- TypeCast |
841
- Duration |
842
- Point { "(" number "," number ")" }
846
+ TypeCast
843
847
  }
844
848
 
845
849
  value[@isGroup=Value] {
@@ -940,11 +944,11 @@ Recurse[since=2_1_0] {
940
944
  }
941
945
 
942
946
  RecurseRange {
943
- number |
947
+ Number |
944
948
  rangeOpOpenBoth |
945
- number rangeOpOpenRight |
946
- rangeOpOpenLeft number |
947
- number rangeOp number
949
+ Number rangeOpOpenRight |
950
+ rangeOpOpenLeft Number |
951
+ Number rangeOp Number
948
952
  }
949
953
 
950
954
  RecurseOptions[since=2_2_0] {
@@ -1005,7 +1009,7 @@ RecordTbIdent {
1005
1009
  bracketIdent
1006
1010
  }
1007
1011
 
1008
- // Ideally we match "number" here, but I cannot for the life of me get it to
1012
+ // Ideally we match "Number" here, but I cannot for the life of me get it to
1009
1013
  // fall back to numberident after. This will suffice for now.
1010
1014
  RecordIdIdent {
1011
1015
  numberident |
@@ -1199,15 +1203,15 @@ SearchAnalyzerClause {
1199
1203
  )*
1200
1204
  }
1201
1205
 
1202
- Bm25Clause { bm25 ( "(" number "," number ")")? }
1203
- DocIdsCacheClause { doc_ids_cache number }
1204
- DocIdsOrderClause { doc_ids_order number }
1205
- DocLenghtsCacheClause { doc_lengths_cache number }
1206
- DocLenghtsOrderClause { doc_lengths_order number }
1207
- PostingsCacheClause { postings_cache number }
1208
- PostingsOrderClause { postings_order number }
1209
- TermsCacheClause { terms_cache number }
1210
- TermsOrderClause { terms_order number }
1206
+ Bm25Clause { bm25 ( "(" Number "," Number ")")? }
1207
+ DocIdsCacheClause { doc_ids_cache Number }
1208
+ DocIdsOrderClause { doc_ids_order Number }
1209
+ DocLenghtsCacheClause { doc_lengths_cache Number }
1210
+ DocLenghtsOrderClause { doc_lengths_order Number }
1211
+ PostingsCacheClause { postings_cache Number }
1212
+ PostingsOrderClause { postings_order Number }
1213
+ TermsCacheClause { terms_cache Number }
1214
+ TermsOrderClause { terms_order Number }
1211
1215
 
1212
1216
  MtreeClause[since=1_3_0] {
1213
1217
  mtree
@@ -1222,7 +1226,7 @@ MtreeClause[since=1_3_0] {
1222
1226
  )*
1223
1227
  }
1224
1228
 
1225
- MtreeCacheClause { mtree_cache number }
1229
+ MtreeCacheClause { mtree_cache Number }
1226
1230
  MtreeDistClause { dist ( Distance ) }
1227
1231
 
1228
1232
  HnswClause[since=1_5_0] {
@@ -1241,14 +1245,14 @@ IndexDimensionClause
1241
1245
  )*
1242
1246
  }
1243
1247
 
1244
- HnswDistClause { dist ( Distance | ( minkowski number )) }
1248
+ HnswDistClause { dist ( Distance | ( minkowski Number )) }
1245
1249
 
1246
- IndexDimensionClause { dimension number }
1247
- IndexCapacityClause { capacity number }
1248
- IndexLmClause { lm number }
1249
- IndexM0Clause { m0 number }
1250
- IndexMClause { m number }
1251
- IndexEfcClause { efc number }
1250
+ IndexDimensionClause { dimension Number }
1251
+ IndexCapacityClause { capacity Number }
1252
+ IndexLmClause { lm Number }
1253
+ IndexM0Clause { m0 Number }
1254
+ IndexMClause { m Number }
1255
+ IndexEfcClause { efc Number }
1252
1256
  IndexExtendCandidatesClause { extend_candidates }
1253
1257
  IndexKeepPrunedConnectionsClause { keep_pruned_connections }
1254
1258
 
@@ -1304,19 +1308,19 @@ TempfilesClause[since=2_0_0] {
1304
1308
 
1305
1309
  FetchClause {
1306
1310
  fetch
1307
- commaSep<Path>
1311
+ commaSep<Idiom>
1308
1312
  }
1309
1313
 
1310
1314
  StartClause {
1311
1315
  start
1312
1316
  at?
1313
- (number | VariableName)
1317
+ (Number | VariableName)
1314
1318
  }
1315
1319
 
1316
1320
  LimitClause {
1317
1321
  limit
1318
1322
  by?
1319
- (number | VariableName)
1323
+ (Number | VariableName)
1320
1324
  }
1321
1325
 
1322
1326
  LimitStartComboClause {
@@ -1465,7 +1469,7 @@ BackendClause {
1465
1469
  // Support
1466
1470
 
1467
1471
  AnalyzerFilters {
1468
- Filter ("(" (number "," number | Ident) ")")?
1472
+ Filter ("(" (Number "," Number | Ident) ")")?
1469
1473
  }
1470
1474
 
1471
1475
  Order {
@@ -1488,11 +1492,11 @@ inclusivePredicate {
1488
1492
 
1489
1493
  LiteralType[since=2_0_0] {
1490
1494
  String |
1491
- number |
1495
+ Number |
1492
1496
  Duration |
1493
1497
  ArrayType { "[" commaSep<type> "]" } |
1494
1498
  ObjectType { objectOpen ObjectTypeContent? "}" }
1495
- // TODO support number and duration types
1499
+ // TODO support Number and duration types
1496
1500
  }
1497
1501
 
1498
1502
  singleType {
@@ -1527,7 +1531,7 @@ Ident {
1527
1531
  tickIdent
1528
1532
  }
1529
1533
 
1530
- number { ("-" | "+")? (Int | Float | Decimal) }
1534
+ Number { ("-" | "+")? (Int | Float | Decimal) }
1531
1535
 
1532
1536
  Operator {
1533
1537
  binaryOperator |
@@ -1536,11 +1540,11 @@ Operator {
1536
1540
  is | ( is opNot ) |
1537
1541
  in | ( opNot opIn ) |
1538
1542
 
1539
- ( "@" number "@" ) |
1543
+ ( "@" Number "@" ) |
1540
1544
  (
1541
1545
  "<|"
1542
- number
1543
- ( "," ( number | Distance | ( minkowski number ) ) )
1546
+ Number
1547
+ ( "," ( Number | Distance | ( minkowski Number ) ) )
1544
1548
  "|>"
1545
1549
  )
1546
1550
  }
@@ -5,7 +5,7 @@
5
5
 
6
6
  ==>
7
7
 
8
- SurrealQL(Comment,Int)
8
+ SurrealQL(Comment,Number(Int))
9
9
 
10
10
  # Dash comment
11
11
 
@@ -14,7 +14,7 @@ SurrealQL(Comment,Int)
14
14
 
15
15
  ==>
16
16
 
17
- SurrealQL(Comment,Int)
17
+ SurrealQL(Comment,Number(Int))
18
18
 
19
19
  # Slash comment
20
20
 
@@ -23,7 +23,7 @@ SurrealQL(Comment,Int)
23
23
 
24
24
  ==>
25
25
 
26
- SurrealQL(Comment,Int)
26
+ SurrealQL(Comment,Number(Int))
27
27
 
28
28
  # Block comment
29
29
 
@@ -33,7 +33,7 @@ SurrealQL(Comment,Int)
33
33
 
34
34
  ==>
35
35
 
36
- SurrealQL(BinaryExpression(Int,BlockComment,Operator,Int))
36
+ SurrealQL(BinaryExpression(Number(Int),BlockComment,Operator,Number(Int)))
37
37
 
38
38
  # Block comment standalone
39
39
 
@@ -41,4 +41,4 @@ SurrealQL(BinaryExpression(Int,BlockComment,Operator,Int))
41
41
 
42
42
  ==>
43
43
 
44
- SurrealQL(BlockComment,Int)
44
+ SurrealQL(BlockComment,Number(Int))
@@ -12,7 +12,7 @@ fn::one::two(1, a)
12
12
 
13
13
  ==>
14
14
 
15
- SurrealQL(FunctionCall(FunctionName,ArgumentList(Int,Ident)))
15
+ SurrealQL(FunctionCall(FunctionName,ArgumentList(Number(Int),Ident)))
16
16
 
17
17
  # Rand function
18
18
 
@@ -20,7 +20,7 @@ rand(3)
20
20
 
21
21
  ==>
22
22
 
23
- SurrealQL(FunctionCall(FunctionName,ArgumentList(Int)))
23
+ SurrealQL(FunctionCall(FunctionName,ArgumentList(Number(Int))))
24
24
 
25
25
  # Count function
26
26
 
@@ -60,4 +60,4 @@ $func(1)
60
60
 
61
61
  ==>
62
62
 
63
- SurrealQL(FunctionCall(VariableName,ArgumentList(Int)))
63
+ SurrealQL(FunctionCall(VariableName,ArgumentList(Number(Int))))
@@ -16,7 +16,7 @@ create bla set true = 1, false = 2, null = 3, none = 4
16
16
  SurrealQL(CreateStatement(
17
17
  Keyword,Ident,
18
18
  SetClause( Keyword,
19
- FieldAssignment(Ident,Operator,Int),
20
- FieldAssignment(Ident,Operator,Int),
21
- FieldAssignment(Ident,Operator,Int),
22
- FieldAssignment(Ident,Operator,Int))))
19
+ FieldAssignment(Ident,Operator,Number(Int)),
20
+ FieldAssignment(Ident,Operator,Number(Int)),
21
+ FieldAssignment(Ident,Operator,Number(Int)),
22
+ FieldAssignment(Ident,Operator,Number(Int)))))
@@ -12,7 +12,7 @@ function(123, 1d2h) {
12
12
  SurrealQL(
13
13
  FunctionJs(
14
14
  FunctionName,
15
- ArgumentList(Int,Duration(DurationPart,DurationPart)),
15
+ ArgumentList(Number(Int),Duration(DurationPart,DurationPart)),
16
16
  JavaScriptBlock(BraceOpen,JavaScriptContent,BraceClose)
17
17
  )
18
18
  )