Skip to content

Instantly share code, notes, and snippets.

@ThierryGoubier
ThierryGoubier / gist:54ba2fcf3cd2e7db9b1e
Last active August 29, 2015 14:16
Python Parser Tests refactoring: RBParseTreeRewritter
| rewrite |
rewrite := RBParseTreeRewriter new
replace: 'self parse: `#l `{:node :dic |
| n |
n := ''source'' , (node methodNode selector allButFirst: 4).
dic at: #n put: n.
PythonParserTests compile: (RBParser parseMethod: n, '' ^ '', `#l newSource) formattedCode classified: ''resources''.
true }'
with: 'self parse: `{:dic |
RBParser parseExpression: ''self '', (dic at: #n) }'.