Browse files

remove unsafe option

  • Loading branch information...
1 parent fb37dcf commit 3771fd8ded17a9e3679dbe0a7b52e2536b9c0efa @contra contra committed Jun 20, 2012
Showing with 2 additions and 34 deletions.
  1. +2 −7 lib/main.coffee
  2. +0 −1 lib/{safe.pegjs → standard.pegjs}
  3. +0 −26 lib/unsafe.pegjs
  4. 0 test/{main.coffee → parse.coffee}
View
9 lib/main.coffee
@@ -2,12 +2,7 @@
{join} = require 'path'
{buildParser} = require 'pegjs'
-safe = buildParser String readFileSync join __dirname, 'safe.pegjs'
-#unsafe = buildParser String readFileSync join __dirname, 'unsafe.pegjs'
+standard = buildParser String readFileSync join __dirname, 'standard.pegjs'
module.exports =
- #unsafe: (command) ->
- # unsafe.parse command
-
- parse: (command) ->
- safe.parse command
+ parse: (command) -> standard.parse command
View
1 lib/safe.pegjs → lib/standard.pegjs
@@ -23,7 +23,6 @@ alphanumeric
Modifications made:
- null actually returns null (kind of a hack around PEG)
- undefined added
- - Strings use ' instead of "
*/
object
View
26 lib/unsafe.pegjs
@@ -1,26 +0,0 @@
-start
- = command:command { return command; }
-
-command
- = head:task tail:(":" task)* {
- var result = {};
- result[head[0]] = head[1];
- for (var i = 0; i < tail.length; i++) {
- result[tail[i][1][0]] = tail[i][1][1];
- }
- return result;
- }
-
-task
- = name:name arg:arguments { return [name.join(""), arg]; }
- / name:name { return [name.join(""), []]; }
-
-arguments
- = "[" "]" { return []; }
- / "[" chars:[^\]]+ "]" { return chars.join(""); }
-
-name
- = alphanumeric+
-
-alphanumeric
- = [a-z0-9_]i
View
0 test/main.coffee → test/parse.coffee
File renamed without changes.

0 comments on commit 3771fd8

Please sign in to comment.