Skip to content

Fix bug in literal parsing #243

@Nahuel-M

Description

@Nahuel-M

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions