first draft of mandatory parentheses around function definition param lists -- all tests pass

This commit is contained in:
Jeremy Ashkenas
2010-01-26 00:40:58 -05:00
parent 63b44a2b03
commit 460b3f6d8e
57 changed files with 1396 additions and 1561 deletions

View File

@@ -3,7 +3,7 @@
# '.', '^', '$', and '*'.
# Search for the regexp anywhere in the text.
match: regexp, text =>
match: (regexp, text) =>
return match_here(regexp.slice(1), text) if regexp[0] is '^'
while text
return true if match_here(regexp, text)
@@ -11,7 +11,7 @@ match: regexp, text =>
false
# Search for the regexp at the beginning of the text.
match_here: regexp, text =>
match_here: (regexp, text) =>
[cur, next]: [regexp[0], regexp[1]]
if regexp.length is 0 then return true
if next is '*' then return match_star(cur, regexp.slice(2), text)
@@ -20,7 +20,7 @@ match_here: regexp, text =>
false
# Search for a kleene star match at the beginning of the text.
match_star: c, regexp, text =>
match_star: (c, regexp, text) =>
while true
return true if match_here(regexp, text)
return false unless text and (text[0] is c or c is '.')