|
6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today Set by moderator on 28 July 2015. |
|||
|
03:11
vendethiel joined
07:56
FROGGS joined
08:29
Ven joined
08:48
pdcawley joined
10:54
Ven_ joined
|
|||
| masak | coming back to my question about `quasi @ Q::Infix { + }` | 14:04 | |
| and your answer "well, obviously, I expect a [Q::Infix]" | 14:05 | ||
| that's the interesting bit, see | |||
| because a Q::Infix object has two properties: lhs and rhs | 14:06 | ||
| and they usually hold the operands, when this operator is sitting somewhere in the middle of an expression tree | |||
| but this `+` kinda doesn't | |||
| it's a leaf node, more like | |||
| as far as I can see, this doesn't happen with any other grammatical cateogry, only with pre/in/postfixes | 14:07 | ||
| because they parse funny -- in the sense that they don't textually contain all their constituent parts, but rely on precedence/associativity instead | |||
|
14:12
Ven joined
14:22
Ven joined
14:39
Ven joined
17:57
vendethiel joined
|
|||
| vendethiel | yeah, but the very confusing is that | 17:58 | |
| I want a Q::Infix | |||
| and there's already an infix in there | |||
| masak | and the parser is poised to parse an infix | ||
| vendethiel | how does it know which rule is associated? :P | 17:59 | |
| masak | now let me drop the other shoe for you: | ||
| this *already happens* inside the parser | |||
| vendethiel | mapping from a Q type to a grammar rule? | ||
| masak | no, passing around degenerate Q::Infix values | 18:00 | |
| here's one end: github.com/masak/007/blob/master/l...#L473-L480 | |||
| vendethiel | okay, but then that wasn't what I meant | ||
| masak | and here's the other: github.com/masak/007/blob/master/l...ns.pm#L240 | ||
| er, eternal links for the backlog: github.com/masak/007/blob/f08031b3...#L473-L480 and github.com/masak/007/blob/f08031b3...ns.pm#L240 | 18:01 | ||
| vendethiel: what did you mean? | |||
| vendethiel | > mapping from a Q type to a grammar rule? | ||
| i.e. "how, there's an Q::Infix here, lemme use that one parsing rule" | |||
| masak | disregarding the fact that 007 doesn't yet do this... | 18:02 | |
| vendethiel | exactly | ||
| masak | ...I assume there'll be an actual hash somewhere that knows what grammar rule to invoke with each Q type | ||
| a bit like the has we use with the Lisp-y syntax, but in reverse :) | 18:03 | ||
| hash* | |||
| vendethiel | 'thought about that as well | 18:04 | |
| masak | anyway, "this already happens" in the parser was the big eye-opener for me. | 18:06 | |
| in that the presence of macro constructs exposes parser internals | |||
|
18:24
FROGGS joined
20:12
vendethiel- joined
|
|||
| vendethiel- | github.com/mindeavor/es-pipeline-operator hehe, what a proposal | 20:32 | |
| masak | cute. | 20:36 | |