Language-independent syntax matching and rewriting
1.1K
Match.find)MATCH:
x = y; <-> x = :[1];
:[1] <-> x = y
NO MATCH:
x = y; <-> y = :[1];
MATCH:
foo ( bar, quux ) <-> foo ( :[1], :[2])
MATCH:
x = a + b; x = c + d; <-> x = :[1] + :[2] => :[1] = a, :[2] = b
Match.all)MATCH:
foo = bar; x = y; quux = bazz <-> x = :[1]; => :[1] = y
foo(bar, quux); foo(foobar, bazz) <-> foo(:[1], :[2])
Environment 1: :[1] = foobar, :[2] = bazz
Environment 2: :[1] = bar, :[2] = quux
Say you add a semicolon to our template: foo(:[1], :[2]);, will only return
one match. Yes, it is that good.
foo(foo(bar, bazz),quux) <-> foo(:[1], :[2])
Environment 1: :[1] = foo(bar, bazz), :[2] = quux
Environment 2: :[1] = bar, :[2] = bazz
Content type
Image
Digest
Size
751.2 MB
Last updated
over 8 years ago
docker pull squareslab/rooibos