Permalink
Browse files

A bit of tidying

  • Loading branch information...
1 parent 395ba23 commit a7ac05b2a4bd9c5fe39c4209a77a7b12614bd646 @pdcawley committed Apr 23, 2012
Showing with 5 additions and 9 deletions.
  1. +5 −9 lesson3/scheem.peg
View
@@ -1,25 +1,21 @@
start =
expression:expression WS { return expression }
-expression =
- atom
- / quotedexpression
- / seq
+expression = atom / quotedexpression / seq
quotedexpression =
WS "'" expression:expression { return [ "quote", expression ] }
seq = WS "(" WS expression:expression* WS ")" { return expression }
-validchar
- = [0-9a-zA-Z_?!+\-=@#$%^&*/.]
+validchar = [0-9a-zA-Z_?!+\-=@#$%^&*/.]
atom = WS chars:validchar+ { return chars.join(""); }
-WS = (comment / onlyWS / NL)*
+WS = (newline / space / comment)*
-onlyWS = [ \t\v\f]
+space = [ \t\v\f]
-NL = "\n" / "\r\n" / "\r"
+newline = "\n" / "\r\n" / "\r"
comment = ";;" (!NL .)* { return column === 1 ? [] : null }

0 comments on commit a7ac05b

Please sign in to comment.