incubator-kie-drools icon indicating copy to clipboard operation
incubator-kie-drools copied to clipboard

[new-parser] Support ISO 8601 format for duration attribute's value

Open yurloc opened this issue 9 months ago • 2 comments

Parent issue

  • #5678

Failing tests

None. Discovered accidentally.

Notes

Add a new test to org.drools.drl.parser.antlr4.MiscDRLParserTest. Related to #5937. Two options:

  • Develop a lexer rule that defines a token for ISO 8601 durations or reuse https://github.com/antlr/grammars-v4/tree/master/iso8601 (if 0BSD is compatible with ASL 2.0). Use the token in the attribute rule in DRLParser.g4.
  • Make the attribute rule less specialized and use the chunk rule for the duration attribute's value. This is the behavior of the old parser's intOrChunkAttribute method.

Rule code snippet

rule R
  duration ("P1DT1M")
when
end

Error output

N/A.

yurloc avatar May 13 '24 18:05 yurloc