Last active
August 29, 2015 14:15
-
-
Save PuercoPop/dd5fb114aad284cd1e15 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
(require ometa) | |
(define-ometa-namespace parser) | |
(define-ometa py-parser | |
(literal (seq (list (atom lit) (bind value (atom anything))) | |
(-> value)))) | |
(omatch | |
py-parser | |
literal | |
'(lit 1) | |
parser) |
in fact for something like you want above, you don't even have to touch Racket code, but rather define a helper rule or grammar that defines the kind of list
you mean in your code. So you can and probably should stay in the realm of OMeta for that one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
argh, did a bunch of edits to my reply. Sorry, I haven't touched this code in a long while and got confused 😄