Skip to content

feat: parse instance data paths#7

Open
HassanAkbar wants to merge 4 commits into
mainfrom
feat/instance-data-paths
Open

feat: parse instance data paths#7
HassanAkbar wants to merge 4 commits into
mainfrom
feat/instance-data-paths

Conversation

@HassanAkbar

Copy link
Copy Markdown
Member

fixes #3

Comment thread lib/lutaml/path/condition.rb Fixed
Comment thread lib/lutaml/path/condition.rb Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Lutaml::Path.parse to support model-instance path syntax (dot navigation plus optional bracketed filter expressions) while preserving the existing element path (::) parsing. It introduces new value objects for instance paths and filter-condition AST nodes, and updates the README and specs accordingly.

Changes:

  • Add InstancePath and Step representations to support dot navigation and attaching parsed filter conditions to individual steps.
  • Add a Condition AST (comparison/membership/existence/logical ops) and parsing rules with operator precedence and grouping.
  • Improve round-tripping (to_s) and equality semantics for parsed paths; document the new behavior in the README.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/lutaml/path_spec.rb Adds extensive coverage for instance-path parsing, filter forms, precedence/grouping, round-trips, and immutability expectations.
README.adoc Documents operator precedence, literal forms, filter-vs-charset rules, and clarifies instance paths are parse-only for now.
lib/lutaml/path/parser.rb Extends grammar to support dot navigation and filter condition parsing with a token-aware “filter sniff”.
lib/lutaml/path/transformer.rb Transforms parse trees into ElementPath/InstancePath, Step, and Condition nodes (but currently contains runtime-breaking transform bugs).
lib/lutaml/path/step.rb Introduces Step to compose PathSegment + optional condition and render appropriately.
lib/lutaml/path/path_segment.rb Preserves raw source for round-tripping and adds value equality/hash; unescapes \:: and \. into name.
lib/lutaml/path/instance_path.rb Adds parse-only InstancePath with structured steps, conditions, to_s, and explicit match? NotImplementedError.
lib/lutaml/path/element_path.rb Makes ElementPath inherit AbstractPath and adds to_s/value equality/hash.
lib/lutaml/path/condition.rb Adds immutable, renderable filter-condition AST node types (AttributeRef, Value, Comparison, etc.).
lib/lutaml/path/abstract_path.rb Adds a common base type holding only absolute?.
lib/lutaml/path.rb Updates require order and ensures parse consistently raises ParseError (including for deep nesting via SystemStackError).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/lutaml/path/transformer.rb
Comment thread lib/lutaml/path/transformer.rb
Comment thread lib/lutaml/path/transformer.rb

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comment thread README.adoc Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comment thread README.adoc Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comment thread lib/lutaml/path/path_segment.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support parsing of model-instance path syntax

3 participants