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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 119563dd70c4e400274c70034d942036f1c07e8525d94dbb1a78fcd9f850be9b
4
- data.tar.gz: 77e331ee47ac3428e2a13e58b461367d2a7d44756515e976cfc54a12a4749a90
3
+ metadata.gz: e06f93fc75dd438aff2b30f8980fff20abedfa426e80c66e329fb9a735102601
4
+ data.tar.gz: 7e4bcfc6f5f7e709bcd61721a3e996f2221e43b254895ff7f9b718675095a94f
5
5
  SHA512:
6
- metadata.gz: d5a7802b011dc8e21c890e9fb3f0c981c856bd03a39c277479fc1e2736de08c345e72085407fb07c5d339b3cd948bfc81e40d19257572f6b415d16a14f68d466
7
- data.tar.gz: a08624024f172abc6602e238c09c6250f23c082b7d7580e8289ad318aec7c41787d039ddf154cdbf8ec60929b4095e23d2585307612717117c8d6befc878cf94
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 = [expect_token(:identifier).value.to_sym]
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 << expect_token(:identifier).value.to_sym
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 = [expect_token(:identifier).value.to_sym]
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 << expect_token(:identifier).value.to_sym
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kumi
4
4
  module Parser
5
- VERSION = '0.0.7'
5
+ VERSION = '0.0.8'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kumi-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kumi Team