Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6035

Some combination of characters in the rule name breaks the ANTLR grammar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

      See https://stackoverflow.com/questions/66212287/what-characters-are-allowed-in-the-name-of-a-rule-in-drools

      I think I have discovered, anecdotally, that some "grouping" characters do not work in rule names (seems rules named with can't be found or aren't included) - or at least, in extension rules (the extended rule seems to work with grouping chars, but not its extension; example below): The grouping chars include parentheses "()", square brackets "[]", and "curly braces" "{}". Although less than & greater than "<>" work, so I'm so far replacing the former with the latter.

      Or are there escape chars for the problematic grouping chars?

      Example:

      rule "(grouping chars, and commas, work here)"
      when
      // conditions LHS
      then
      end

      // removing parentheses, or replacing with < >,
      // from below line works
      rule "(grouping chars DON'T work here)"
      extends "(grouping chars, and commas, work here)"
      when
      then
      // consequences RHS

            lmolteni@redhat.com Luca Molteni
            lmolteni@redhat.com Luca Molteni
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: