kumi-parser 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/kumi/parser/direct_parser.rb +16 -5
- data/lib/kumi/parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e06f93fc75dd438aff2b30f8980fff20abedfa426e80c66e329fb9a735102601
|
4
|
+
data.tar.gz: 7e4bcfc6f5f7e709bcd61721a3e996f2221e43b254895ff7f9b718675095a94f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48eedfdcc441a14209d03cf9640f171ed924e09c0e8af48634626967b8fb2d65a5b4e93b8007c6411b2f098ecdbd40e1b5fe15bcb8d1343a1e8c449402713c7f
|
7
|
+
data.tar.gz: 482817510f74d70f0a8e8d4547e9ff1aafac2ed29cc2d3629cf244fb7e3d1e8966005be25caaeca549951cd23271f5c28597430cb635b11dabbb952a66b63e75
|
@@ -387,12 +387,12 @@ module Kumi
|
|
387
387
|
input_token = expect_token(:identifier) # 'input'
|
388
388
|
expect_token(:dot)
|
389
389
|
|
390
|
-
path = [
|
390
|
+
path = [expect_field_name_token.to_sym]
|
391
391
|
|
392
392
|
# Handle nested access: input.field.subfield
|
393
393
|
while current_token.type == :dot
|
394
394
|
advance # consume '.'
|
395
|
-
path <<
|
395
|
+
path << expect_field_name_token.to_sym
|
396
396
|
end
|
397
397
|
|
398
398
|
if path.length == 1
|
@@ -406,12 +406,12 @@ module Kumi
|
|
406
406
|
input_token = expect_token(:input) # 'input' keyword token
|
407
407
|
expect_token(:dot)
|
408
408
|
|
409
|
-
path = [
|
409
|
+
path = [expect_field_name_token.to_sym]
|
410
410
|
|
411
411
|
# Handle nested access: input.field.subfield
|
412
412
|
while current_token.type == :dot
|
413
413
|
advance # consume '.'
|
414
|
-
path <<
|
414
|
+
path << expect_field_name_token.to_sym
|
415
415
|
end
|
416
416
|
|
417
417
|
if path.length == 1
|
@@ -520,6 +520,17 @@ module Kumi
|
|
520
520
|
end
|
521
521
|
end
|
522
522
|
|
523
|
+
def expect_field_name_token
|
524
|
+
# Field names can be identifiers or keywords (like 'base', 'input', etc.)
|
525
|
+
token = current_token
|
526
|
+
if token.identifier? || token.keyword?
|
527
|
+
advance
|
528
|
+
token.value
|
529
|
+
else
|
530
|
+
raise_parse_error("Expected field name (identifier or keyword), got #{token.type}")
|
531
|
+
end
|
532
|
+
end
|
533
|
+
|
523
534
|
def raise_parse_error(message)
|
524
535
|
location = current_token.location
|
525
536
|
raise Errors::ParseError.new(message, token: current_token)
|
@@ -547,7 +558,7 @@ module Kumi
|
|
547
558
|
when :lte then :<=
|
548
559
|
when :and then :and
|
549
560
|
when :or then :or
|
550
|
-
when :exponent then
|
561
|
+
when :exponent then :power
|
551
562
|
else token_type
|
552
563
|
end
|
553
564
|
end
|
data/lib/kumi/parser/version.rb
CHANGED