Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-09-29

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

All times shown according to UTC.

Time Nick Message
00:47 ronsavage joined #marpa
02:01 flaviu1 joined #marpa
03:00 jeffreykegler Always interesting to read my own docs.  Not long ago I stated (correctly) that there is no EOF for Marpa::R2, since it only trades in strings, so ...
03:00 jeffreykegler it is interesting to read my own docs and see that I refer to EOF.
03:00 jeffreykegler Fixed in the next release. :-)
05:39 ronsavage joined #marpa
06:35 lwa joined #marpa
08:02 shadowpaste "ronsavage" at 124.170.27.143 pasted "Single quoted string 'v' Unquoted string" (224 lines) at http://scsys.co.uk:8002/426277
08:03 ronsavage Re http://scsys.co.uk:8002/426277. In the 1st string why is the 4th event (on 'L') an unquoted string and not a single quoted string, as in the 2nd string?
08:04 ronsavage Changing the definition of string_token, in the BNF, from '| unquoted_string' to '|| unquoted_string' makes no difference, and neither does reversing the 2 RHS tokens.
08:43 lwa ronsavage: (1) Your event handling seems to be b0rked, as you only handle one event at any recognizer pause. Instead of `$event_name = ${ $event[0] }[0]`, loop over all events: `for my $event_name (map $_->[0], @{ $recce->events }) { ... }`. (2) Your unquoted strings can contain single quotes, so 'A' is a valid unquoted string. See `unquoted_char_set ~ ... | [^;:]`. That char class should be `[^;:']`
08:46 lwa Note that `|` vs. `||` does not affect how your input is recognized. Priorities are entirely irrelevant for Earley parsing. They are only important when handling precedence, and are used when assembling the parse tree.
09:03 ronsavage lwa: Thanx. I shall investigate.
09:07 ronsavage Changing the class to [^;:'] stops ' appearing in other types of strings, e.g. a: A'B. Still......
09:13 ronsavage The other thing was to put priority clauses on the :lexeme statements (single quoted as 1 and unquoted as 0 - the default). That did not change anything.
09:30 lwa ronsavage: It's not clear what you would consider to be an unquoted or quoted string, and what should be an error. Consider: «'ab'», «'ab», «ab'», «a'b'», «'a'b», «a'b», «'a'b'c'». Do you want all of these except the first to parse as unquoted strings?
09:34 ronsavage Good question. In the real app, internal single quotes must be escaped. I suspect I'll have to regard them all as (unquoted) strings.
09:35 lwa Additional tricky cases: «''», «'». Also: «'; foo:bar'» – is that one single quoted string (as LATM would probably suggest), or a unquoted string «'» followed by another pair with key «foo» and value «bar'»
09:39 ronsavage The code works with the 1st and 3rd of your last set. It's the cases where the quotes are (1) ' at the start, and (2) unbalanced, which are problematic.
09:47 ronsavage By " I'll have to regard them all as (unquoted) strings. " I mean I'll have to manually scan them.
10:00 ronsavage On 2nd thoughts, I'll abandon the concept of quoted strings, and fix the grammar to accept all chars except [;], but still accept '\' [;].
10:25 shadowpaste "ronsavage" at 124.170.27.143 pasted "Another string parsing BNF" (210 lines) at http://scsys.co.uk:8002/426293
10:25 ronsavage This is what I've ended up with: http://scsys.co.uk:8002/426293
16:04 jeffreykegler joined #marpa
18:00 lwa joined #marpa
19:03 jeffreykegler If you read the current discussions about the future of Perl, you'd think how a language is numbered is far more important than how it is parsed.
19:48 flaviu1 joined #marpa
21:19 ronsavage jeffreykegler: Sure - but if lemming keep flocking to non-Perl languages, it's bad for Perl no matter how good the language is, nor how it's parsed.
21:19 ronsavage 'lemming' => 'lemmings'
22:39 ronsavage joined #marpa

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