gss / parser

Constraint Cascading Style Sheets compiler
MIT License
48 stars 6 forks source link

Fix order of Strength rules #16

Closed paulyoung closed 10 years ago

paulyoung commented 10 years ago

As discovered in the-gss/vfl-compiler#7, "required" is unreachable because "require" will always match first.

Strength
  = ("require"  / "REQUIRE"  / "Require")  { return grammar.strength().require(); }
  / ("strong"   / "STRONG"   / "Strong")   { return grammar.strength().strong(); }
  / ("medium"   / "MEDIUM"   / "Medium")   { return grammar.strength().medium(); }
  / ("weak"     / "WEAK"     / "Weak")     { return grammar.strength().weak(); }
  / ("required" / "REQUIRED" / "Required") { return grammar.strength().required(); }

The rule for "required" should be moved to the top.