Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-10-04

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 harovali ronsavage: regarding [.]+ , I could go farther by explicitely saying what characters will be in the character class. Are there restrictions to what goes into . apart from newline ?
00:01 harovali idiosyncrat_ : true , very true, that's the central problem.
00:02 harovali I could go somewhat farther, although I'm dealing with all sort of problems as I advance
00:02 harovali I'd like to know of those tricks !
00:26 ronsavage joined #marpa
00:27 idiosyncrat_ joined #marpa
00:28 idiosyncrat_ harovali1: re the "tricks"
00:28 idiosyncrat_ Preferable is, if your newlines are always semantic, to move the up to G1.  But if that's not the case ...
00:29 ronsavage harovali: The chars in [...] are documented under Perl. See http://perldoc.perl.org/perlre.html and http://perldoc.perl.org/perlretut.html and http://perldoc.perl.org/perlrequick.html.
00:30 ronsavage These URLs are documented in my module https://metacpan.org/pod/Regexp::Parsertron.
00:31 idiosyncrat_ Trick #1: Make <Body> a lexeme, handling it at L0 level, and slurp in everything that is not a colon (':').
00:32 idiosyncrat_ Under LATM (Longest Acceptable Token Matching), this will make <Body> the longest lexeme, and this (I think) will override the discarding of newlines.
00:34 idiosyncrat_ Trick #2: Create either a prediction or a pre-lexeme or post-lexeme event for <Body>, lex <Body> using Perl code, then once you have <Body> resume the normal processing.
00:35 idiosyncrat_ The events are documented here: https://metacpan.org/pod/distribution/Marpa-R2/pod/Event.pod#Prediction-events
00:36 sirdancealot joined #marpa
00:38 idiosyncrat_ Among the factors in choosing your events, if you pick a prediction event, you don't have to worry about how you define it in the SLIF -- <Body> will be read by your Perl code, and your statement can even be something like
00:38 idiosyncrat_ body ~ [^\d\D]
00:39 idiosyncrat_ which IIRC correctly never matches.
00:39 idiosyncrat_ If you pick a pre- or post-lexeme event, then your pattern will actually have to match in the input.
00:41 idiosyncrat_ Trick #2 with a prediction event is the most general solution -- it can handle anything.  The downside is that you'll have to code all the logic for recognizing <Body> yourself in Perl -- you'll have turned off all of Marpa's helpful features except for one that is all-important:
00:42 idiosyncrat_ Marpa will find for you where a <Body> should start.
00:42 idiosyncrat_ Hope this helps.
00:45 idiosyncrat_ joined #marpa
00:47 ceridwen joined #marpa
02:09 ronsavage joined #marpa
04:54 idiosyncrat_ Good night!
05:51 ronsavage joined #marpa
07:06 sirdancealot joined #marpa
07:33 ronsavage joined #marpa
14:10 sirdancealot joined #marpa
20:38 choroba joined #marpa
21:39 ronsavage joined #marpa
23:08 Idiosyncrat joined #marpa
23:09 Idiosyncrat joined #marpa

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary