Quick actions

cmd+k|ctrl+k

Navigation

Languages

demo-proper-tokenizing

Snippet info

Language

Raku

Visibility

public

Author

raiph

Created

2024-04-23T17:02:27.881676Z

Updated

2024-04-23T17:19:23.014431Z

say .parse: $*IN.slurp given grammar {
    rule TOP         { <identifier> <identifier> '=' <expression> }
    token ws         { [ <comment> | \s+ ]* <!ww> }
    token comment    { '#[' <-[\]]>* ']' }
    token identifier { \w+ }
    rule expression  { '(' <expression> ')' | <number> | <string> | ... }
    token number     { \d+ }
    token string     { '"' <-["]>* '"' }
}
INFO