Ohm-S icon indicating copy to clipboard operation
Ohm-S copied to clipboard

Unexpected difference between lexical and syntactic rule

Open stlutz opened this issue 5 years ago • 0 comments

I was using the following rules in Ohm-S:

Text {
  TextRule
    = text

  textCharacter
      = "\\\""
      | "\\\\"
      | ~"\\" ~"\"" any

  text
    = "\"" textCharacter+ "\""
}

When trying to match the input Hello World starting from text everything works as expected and the string is correctly matched. When starting from TextRule, however, the expression can not be matched.

I tried the very same setup in Ohm/JS, which was able to match with either rule as the starting rule.

stlutz avatar Jul 11 '19 15:07 stlutz