Browse Source

parser: Fix loose 'selector' definition.

Herbert Vojčík 7 years ago
parent
commit
cdde6f7229
2 changed files with 224 additions and 265 deletions
  1. 223 263
      support/parser.js
  2. 1 2
      support/parser.pegjs

File diff suppressed because it is too large
+ 223 - 263
support/parser.js


+ 1 - 2
support/parser.pegjs

@@ -6,7 +6,6 @@ ws             = (separator / comments)*
 maybeDotsWs = ("." / separator / comments)*
 identifier     = first:[a-zA-Z] others:[a-zA-Z0-9]* {return first + others.join("");}
 keyword        = first:identifier last:":" {return first + last;}
-selector      = first:[a-zA-Z] others:[a-zA-Z0-9\:]* {return first + others.join("");}
 className      = first:[A-Z] others:[a-zA-Z0-9]* {return first + others.join("");}
 string         = "'" val:(("''" {return "'";} / [^'])*) "'" {
                      return $globals.ValueNode._new()
@@ -22,7 +21,7 @@ character      = "$" char:.
                              ._value_(char);
                   }
 symbol         = "#" rest:bareSymbol {return rest;}
-bareSymbol         = val:(selector / binarySelector / node:string {return node._value();})
+bareSymbol         = val:(keywords:keyword+ {return keywords.join("");} / binarySelector / unarySelector / node:string {return node._value();})
                   {
                       return $globals.ValueNode._new()
                              ._location_(location())

Some files were not shown because too many files changed in this diff