Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in literal parsing #243

Open
Nahuel-M opened this issue Aug 14, 2023 · 0 comments
Open

Fix bug in literal parsing #243

Nahuel-M opened this issue Aug 14, 2023 · 0 comments

Comments

@Nahuel-M
Copy link
Contributor

Nahuel-M commented Aug 14, 2023

A literal called TrueNorth will be parsed as Literal::Logical True + remainder "North", instead of being parsed as Literal::String "TrueNorth"

I encountered this while trying to parse the IFC express schema.

The following example triggers the issue:

let st = espr::ast::SyntaxTree::parse(
  "SCHEMA IFC4X3_DEV_6a23ae8;
  ENTITY IfcGeometricRepresentationContext;
   WHERE
	  North2D : NOT(EXISTS(TrueNorth)) OR (HIINDEX(TrueNorth.DirectionRatios) = 2);
  END_ENTITY;
  
  END_SCHEMA;"
).unwrap();

I expect this is fixable using nom::combinator::peek to check for a following character.
Are you accepting pull requests?

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

No branches or pull requests

1 participant