hpi-swa / Ohm-S

A Squeak/Smalltalk implementation of the metaprogramming framework Ohm.
MIT License
24 stars 8 forks source link

Unexpected difference between lexical and syntactic rule #42

Open stlutz opened 5 years ago

stlutz commented 5 years ago

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.