00:32 yewscion left 00:55 SrainUser left 02:07 ulipink left 02:40 guifa joined 02:44 hulk joined, kylese left 02:45 ulipink joined 02:51 ulipink left 03:12 ulipink joined, ulipink left, ulipink joined 03:15 hulk left, kylese joined 03:18 ulipink left
grondilu Hello. Please look at this gist.github.com/grondilu/ebceff32e...fdb4516f24 and tell me what I am missing. 03:30
03:31 zetaaaa left
grondilu basically I'm trying to catch a pattern in a multiline string but the regex grabs all the trailing newlines. 03:31
m: say grammar { rule TOP { ^ <line>+ $ }; rule line { <.alpha>+ } } .parse: "foo\n" 03:37
camelia 「foo

line => 「foo
grondilu how can I extract "foo" and not "foo\n"? 03:38
03:39 ulipink joined
grondilu in a nutshell I want to parse a file with blocks of text separated by empty lines. 03:39
that can't work as I've tried if the regex catches trailing newlines. 03:40
guifa I would use token instead 03:42
or change <ws> to be \h
so 03:43
say grammar { rule TOP { <line> %% \n }; rule line { <.alpha>+ } } .parse: "foo\nbar\nxyz\n" 03:44
m: say grammar { rule TOP { <line> %% \n }; rule line { <.alpha>+ } } .parse: "foo\nbar\nxyz\n"
camelia ===SORRY!=== Error while compiling <tmp>
Missing quantifier on the left argument of %%
at <tmp>:1
------> say grammar { rule TOP { <line> %%<HERE> \n }; rule line { <.alpha>+ } } .parse:
guifa m: say grammar { rule TOP { <line>+ %% \n }; rule line { <.alpha>+ } } .parse: "foo\nbar\nxyz\n"
camelia Nil
guifa m: say grammar { token TOP { <line>+ %% \n }; token line { <.alpha>+ } } .parse: "foo\nbar\nxyz\n" 03:45
camelia 「foo
bar
xyz

line => 「foo」
line => 「bar」
line => 「xyz」
grondilu tries
grondilu fails 03:47
03:48 guifa left
grondilu m: say grammar { token TOP { <line>+ %% \n }; token line { <.alpha>+ } } .parse: "foo\n\nbar\n\nxyz\n" 03:49
camelia Nil
grondilu there is no empty line in "foo\nbar"
ugexe <.alpha>* 03:55
03:59 ulipink left 04:19 pony left 04:27 Aedil left 04:33 Aedil joined, nine left, camelia left, nine_ joined 04:41 camelia joined 05:09 ulipink joined 05:10 yewscion joined 05:13 yewscion left 06:11 yewscion joined 06:16 yewscion left 06:55 tejr joined 07:41 Sgeo left 08:22 yewscion joined 08:26 yewscion left 08:34 renormalist left 09:20 yewscion joined 09:22 yewscion left 09:33 sena_kun joined 09:39 sena_kun left
grondilu m: my $pgn = "e4 e5\n\ne4 d5\n"; $pgn.match(/[<ident>+ % <ws>]+ % [^^$$]/) 09:54
camelia ( no output )
grondilu m: my $pgn = "e4 e5\n\ne4 d5\n"; say $pgn.match(/[<ident>+ % <ws>]+ % [^^$$]/)
camelia 「e4 e5

e4 d5」
ident => 「e4」
ws => 「 」
ident => 「e5」
ws => 「


ident => 「e4」
ws => 「 」
ident => 「d5」
grondilu m: my $pgn = "e4 e5\n\ne4 d5\n"; say grammar { regex TOP { [<ident>+ % <ws>]+ % [^^$$] } }.parse: $pgn 09:55
camelia Nil
grondilu yet it's the exact same regex!
grondilu throws hand in the air in despair 09:56
09:57 yewscion joined
lizmat perhaps Grammar::Debugger/Tracer can be of help ? 09:59
10:00 yewscion left 10:25 msiism left 12:25 kathe joined
kathe Hello to everybody. :) 12:25
timo greetings
kathe I don't know if Mr Wall hangs out over here anymore. In case he still does: 12:26
I tasted "Pepsi" yesterday, and honestly, I liked it.
As opposed to my preference from ThumbsUp and Coca Cola. 12:27
The Pepsi people have made some changes to their formula,
as far as the Indian market goes. It is not as sweet as it used to be before. 12:28
Alrighty, bye to everybody, and I hope Raku not just survives, but also thrives.
Have a great time ahead. :)
12:29 kathe left