mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-05-28 08:41:28 +00:00
fixed bug in binary operator parsing
This commit is contained in:
parent
244984ab8f
commit
08827cf2ca
|
@ -39,8 +39,12 @@
|
|||
[(:or \; nil) false] result
|
||||
[(:or \space \t) true ] (recur tail [] nil (close-partial-token))
|
||||
[(:or \space \t) false] (recur tail [] nil result)
|
||||
[(_ :guard binary-op?) true ] (recur line [] nil (close-partial-token))
|
||||
[(_ :guard binary-op?) false] (recur tail
|
||||
; if it's an operator of any kind and we're currently parsing a token,
|
||||
; close the partial token and recur on the same character.
|
||||
[(_ :guard operators) true] (recur line [] nil (close-partial-token))
|
||||
; we don't have to check here if the binary operator is false because
|
||||
; if it weren't, it would have been caught by the less restrictive line above.
|
||||
[(_ :guard binary-op?) _] (recur tail
|
||||
[]
|
||||
nil
|
||||
(conj-with-metadata result (str head) current-pos))
|
||||
|
|
Loading…
Reference in New Issue
Block a user