incubator-kie-drools
incubator-kie-drools copied to clipboard
[new-parser] Support ISO 8601 format for duration attribute's value
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 inDRLParser.g4
. - Make the
attribute
rule less specialized and use thechunk
rule for theduration
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.