Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Last active August 29, 2015 14:15
Show Gist options
  • Save PuercoPop/dd5fb114aad284cd1e15 to your computer and use it in GitHub Desktop.
Save PuercoPop/dd5fb114aad284cd1e15 to your computer and use it in GitHub Desktop.
(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)
@vkz
Copy link

vkz commented Feb 17, 2015

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