Browse files

Merge pull request #1 from tmm1/patch-1

Add support for nested functions and booleans.
  • Loading branch information...
2 parents c466b22 + 12a6a97 commit 1d0330f2e74fe6268793c6e605e34cb113997f5f @assaf committed Jan 18, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/grammer.pegjs
View
9 lib/grammer.pegjs
@@ -22,7 +22,7 @@ arguments
}
argument
- = number / string / series
+ = boolean / number / string / function / series
/* Parses into an object with the property series, which contains the FQN. Will parse glob patterns as well.
@@ -56,3 +56,10 @@ number
= sign:[-+]? integer:[0-9]+ "."? fraction:[0-9]* {
return { number: parseFloat(sign + integer.join("") + "." + fraction.join("")) }
}
+
+/* Parses into an object with the property boolean.
+ */
+boolean
+ = value:("true" / "false") {
+ return { boolean: value == 'true' }
+ }

0 comments on commit 1d0330f

Please sign in to comment.