You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Giving multiple identical arguments to something like [<item>...] returns only one instance of the argument. python docopt does the right thing. Example:
Now, coffee bug.coffee a a a returns { '<item>': [ 'a' ] }
whereas it really ought to return { '<item>': [ 'a', 'a', 'a' ] }
The problem is with this line in the Argument class: left = (l for l in left when l.toString() isnt args[0].toString())
which will take out every instance matching args[0] when it really ought to remove only the first one, like in the python implementation.
I changed it as follows to make it work
- left = (l for l in left when l.toString() isnt args[0].toString())
+ idx = left.indexOf args[0]
+ left = left.slice(0, idx).concat(left.slice(idx + 1))
but I don't know coffeescript so maybe there's a better way of doing it.
The text was updated successfully, but these errors were encountered:
Giving multiple identical arguments to something like
[<item>...]
returns only one instance of the argument. python docopt does the right thing. Example:Now,
coffee bug.coffee a a a
returns{ '<item>': [ 'a' ] }
whereas it really ought to return
{ '<item>': [ 'a', 'a', 'a' ] }
The problem is with this line in the Argument class:
left = (l for l in left when l.toString() isnt args[0].toString())
which will take out every instance matching args[0] when it really ought to remove only the first one, like in the python implementation.
I changed it as follows to make it work
but I don't know coffeescript so maybe there's a better way of doing it.
The text was updated successfully, but these errors were encountered: