mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
trying out new arrows for function literals -> is a function, => is a bound function
This commit is contained in:
@@ -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 '.')
|
||||
|
||||
Reference in New Issue
Block a user