Last active
October 17, 2018 10:44
-
-
Save scientific-coder/b642e118afb07f524b1cf7b55aa8d727 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def addsub-parser | |
(instaparse.core/parser | |
"prog= spaces? add-sub spaces? | |
<add-sub> = number | add | sub | |
add= add-sub spaces? <'+'> spaces? number | |
sub= add-sub spaces? <'-'> spaces? number | |
number= #'-?[0-9]+' | |
<spaces> = <#'\\s+'>")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment