ruststep
ruststep copied to clipboard
Fix bug in literal parsing
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?