Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-03-18

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

All times shown according to UTC.

Time Nick Message
00:14 Cheery joined #marpa
01:17 ronsavage1 joined #marpa
05:17 Pursuit joined #marpa
05:23 ronsavage joined #marpa
06:28 ronsavage joined #marpa
07:02 koo7 joined #marpa
14:13 koo7 joined #marpa
16:00 koo7 joined #marpa
18:43 VsyachePuz http://www.cliki.net/CL-EARLEY-PARSER
20:11 choroba joined #marpa
20:38 EMPeror_ joined #marpa
21:06 idiosyncrat_ joined #marpa
21:12 choroba Hi. If I want to get "nice" error messages from the parser (where the parsing stopped and why), is http://blogs.perl.org/users/jeffre​y_kegler/2012/10/a-marpa-dsl-tutor​ial-error-reporting-made-easy.html still the way to go?
21:21 idiosyncrat_ chroroba: Looks like it is pre-SLIF
21:22 idiosyncrat_ If I were doing an updated version, I'd probably start by reading that post, and I think it's way of analyzing things would be a least a good start.]
21:23 idiosyncrat_ Of course, what "convenient error reporting" consists of really depends on the target language.
21:23 choroba I already have a scanless marpa ready, I just want to add the details about failures
21:24 choroba so, the question is, whether there are any new ways how to get the details, as the article mentions "a prime candidate to be folded into the Marpa interface someday"
21:25 btyler joined #marpa
21:26 choroba If you're interested, here's the parser: https://github.com/choroba/karel​/blob/master/lib/Karel/Parser.pm
21:33 idiosyncrat_ I think https://metacpan.org/pod/Marpa:​:R2::Scanless::R#last_completed may be what resulted
21:36 idiosyncrat_ Looks interesting.  It's a robotics DSL?
21:44 choroba https://en.wikipedia.org/wiki/K​arel_%28programming_language%29
21:44 choroba virtual robot only
22:45 choroba hm... I'm able to get some of the information the user might benefit from. But sometimes, a valid token is not listed among "terminals_expected"
22:46 choroba Also, it would be nice to have a way to wrap the "No lexeme found" exception
22:53 choroba e.g. here: https://github.com/choroba/karel/commit/a​c129bfdc497ce7e328afd46a0b8297f7d152f68#d​iff-da71c3c3ea3f2c4f183745a2df2b10baR164
22:53 choroba I'd expect "end" as one of the expected lexemes, too
22:54 choroba or its corresponding [Lex-42]
22:57 idiosyncrat_ If you want this, you should name the lexeme:
22:57 idiosyncrat_ end_token ~ "end"
22:58 idiosyncrat_ (all this is off the top of my head and untested)
22:58 idiosyncrat_ If you want to refer to a lexeme it needs a name, and the string it matches, even if it is a constant string, is not a name.
22:59 idiosyncrat_ As for <[Lex-42]>, that's an internal name, and subject to change.
22:59 idiosyncrat_ For example, as light reordering of things might change the number '42' to '41' or '43'
23:00 idiosyncrat_ I didn't add features to deal with these because they seemed to me to complicate more than they helped.
23:01 idiosyncrat_ Treating constant strings as part of the lexeme name space meant combining two sets of names built on different principles and there would be all sorts of tricky special cases.
23:02 idiosyncrat_ Ditto with allowing the user to rely on internal names.
23:03 idiosyncrat_ It seemed easiest to force the user who want to access a constant string as a named lexeme, to actually give the lexeme the name of their choice.
23:03 choroba but the 'end' is not returned even if I name it
23:04 choroba maybe because it's expected by a "higher" rule?
23:05 choroba it closes a Def
23:05 idiosyncrat_ Did you make it a lexeme?
23:05 choroba (you can view the grammar if you click on the "stretch" icon at the top above line 47)
23:06 choroba yes
23:07 idiosyncrat_ The link does not seem to have a line 47 nearby.
23:07 choroba at the top
23:07 choroba of the page
23:08 choroba or here: https://github.com/choroba/karel/blob/ac129bfdc49​7ce7e328afd46a0b8297f7d152f68/lib/Karel/Parser.pm
23:08 choroba maybe it's because we are in a Def+ ?
23:08 choroba 67 it is
23:09 choroba and inside of Def+, we are in Command+
23:10 idiosyncrat_ 67?  That line is this:  | 'drop-mark'                                   action => drop
23:10 choroba yeah, and above it, there's an icon
23:10 choroba above the line number in the previous link
23:10 idiosyncrat_ 'end' is in line 60
23:10 choroba yes
23:11 idiosyncrat_ And it is a quoted string.
23:11 choroba I changed it into a lexeme, but the output is still the same
23:11 idiosyncrat_ So it will only have an internal name.
23:11 idiosyncrat_ Can you create a minimal example?
23:11 choroba I'll try
23:11 ronsavage joined #marpa
23:12 idiosyncrat_ Because if a named, non-internal, terminal is expected, it should appear in the list of expected terminals.
23:15 idiosyncrat_ If the behavior is as you describe, it might very well be a serious problem, one that would need to be fixed.
23:16 idiosyncrat_ A lot of people have used this code, and not encountered any issues, but that doesn't mean that it's impossible for there to be a bug in it, some corner case which so far has not been noticed.
23:17 idiosyncrat_ AFK for a bit
23:48 choroba oh, error on my side
23:48 choroba I trimmed the input before parsing

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