Skip to content

Instantly share code, notes, and snippets.

@Mouq
Mouq / gist:7eb9d723d7f05a511529
Last active January 6, 2016 00:25 — forked from anonymous/gist:4beb237a975e65e6e775
perl6 grammar test
grammar Test {
rule TOP { ^ <content>* $ }
rule block { '(' ~ ')' <content>* }
rule content { <-[()]>+ || <block> }
}
class TestActs {
method TOP($/) {
$/.make: $<content>».made.join;
}
@Mouq
Mouq / gist:8950902
Last active August 29, 2015 13:56 — forked from anonymous/gist:8928045
say("+123.456e10" ~~ /
:my token SIGN { <[+-]> }
:my token MANTISSA { \d+ '.'? \d* | '.' \d+ }
:my token EXPONENT { <[eE]> <SIGN>? \d+ }
<SIGN>? <MANTISSA> <EXPONENT>?
/)
# ∂