Camelia, the Perl 6 bug

IRC log for #parrot, 2012-09-11

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:20 kid51 Boa noite, whiteknight
00:20 * kid51 practices his Portuguese for class tomorrow
00:42 benabik joined #parrot
00:48 whiteknight hello kid51
02:09 MikeFair joined #parrot
02:12 MikeFair Good evening #parrot! :)
02:28 MikeFair I am havinga bit of a problem coming up with the Grammar syntax that works for the "if statement" I'm trying to make
02:29 MikeFair The main problem I'm having is that there's no clearly defined end point every time so I'm having difficulty figuring out how to create the rule for it
02:30 MikeFair if <EXPR> then <statement>* [ else <statement>* ]? ['end if']?
02:30 MikeFair Is kind of what I'm looking for
02:32 MikeFair however if there is no 'else' or 'end' 'if' after the 'then' - only one single statement should be included in the <thenPart>
02:33 MikeFair and if there is no 'end' 'if' after the 'else' -only one single statement should be included in the <elsePart>
02:34 MikeFair Examples I've looked at have assumed only one 'block' or one 'statment' would follow the then or else because they have used {} or similar delimiters
02:35 MikeFair I've considered trying to make 'then' .* ['else' | 'end' ] a "block" type thing
02:36 MikeFair But it would have to be more like <?before 'else' | 'end'>
02:36 mvorl joined #parrot
02:37 MikeFair Thoughts/discussion on the issue would be welcomed - thx
02:37 MikeFair hi there mvorl
02:38 mvorl Hi MikeFair & #parrot
02:38 sorear hello!
02:39 MikeFair hi there sorea! :)
02:39 MikeFair err sorear even!
02:39 sorear MikeFair: if <EXPR> then <statement> [ <statement>* end if ]
02:39 sorear extending this to handle else is left as an exercise.
02:40 * MikeFair nods
02:40 sorear actually it should be if <EXPR> then [ <statement> [ <statement>* end if ]? || end if ]
02:41 MikeFair oh interesting
02:41 sorear this is an LL(infinity) grammar engine, you need to left-factor
02:41 MikeFair I had this was 'almost working'
02:41 MikeFair ule thenPart {
02:41 MikeFair 'then' <statement>* <?before 'else' | 'end' 'if'>
02:41 MikeFair | 'then' <statement>
02:42 MikeFair but it didn't properly terminate when there was only one command and no end i
02:42 MikeFair if
02:42 sorear your use of <?before> there seems quite wrong.
02:43 sorear also, it's not left factored.
02:43 MikeFair Yeah I haven't been really mastering "left factoring" yet :)
02:44 MikeFair It's gotten me into some cute trouble and I quickly learned "doctor it hurts when I infinitely recurse!" :)
02:44 * MikeFair gives the above a shot.
02:46 MikeFair the <?before> has seemingly been doing what I expect, "find the 'else' | 'end' 'if' and match the text before it
02:47 MikeFair Explanations I've read online have explained it as like having a "run to this point" GOAL
02:47 MikeFair but what I'm not clear on is how it will behave if the if statements are nested
02:48 sorear here's how it really works:
02:48 MikeFair I'm expecting the recursive part should justtake care of that
02:48 sorear regex position is before <statement>* <?before ...>
02:48 sorear input looks like 1; 2; end if
02:49 * MikeFair nodsl.
02:49 sorear first we try to match a statement because <statement>*
02:49 sorear 2; end if
02:49 sorear now because * we match another statement
02:49 sorear end if
02:49 sorear now because * we try again
02:49 sorear end if is not a statement, so the <statement> rule *fails*
02:49 sorear <?before> sees that the current position is before "end if", so it does nothing
02:50 sorear the only thing <?before> does is, sometimes, make matches fail
02:50 sorear it has no effect on anything before or after it
02:51 MikeFair But it has left the cursor in the right position for matching on the next part for me
02:51 MikeFair but that might have been a side effect of other things
02:51 sorear <?before> never moves the cursor.
02:52 sorear the cursor moved as a result of <statement> _only_
02:53 MikeFair sorear: It might not be needed anymore, I put it in there because I was having a problem with <statement>* consuming too much
02:53 sorear MikeFair: here's how that works:
02:53 MikeFair but that was with a completely different attempt at using a <statement_list> instead of a <statement>*
02:53 sorear if you put in <?before> and it *fails*, you backtrack
02:53 sorear it forgets the last <statement> and pretends it didn't match after all
02:54 sorear and tries again at the previous place
02:55 MikeFair sorear: which in my case would trigger the alternate rule of 'then' <statement>
02:55 MikeFair but I think I can see why it's not working
02:57 dalek parrot/native_pbc2: 8f65204 | rurban++ | / (3 files):
02:57 dalek parrot/native_pbc2: Better bitfiddling with the intel 63 normalize bit
02:57 dalek parrot/native_pbc2:
02:57 dalek parrot/native_pbc2: cvt_num16_num10 clears now bit 63
02:58 dalek parrot/native_pbc2: cvt_num10_num16 tries to shift-copy the mantissa ignoring this bit
02:58 dalek parrot/native_pbc2:
02:58 dalek parrot/native_pbc2: Test precision regex seems to be stable now.
02:58 dalek parrot/native_pbc2: review: https://github.com/parrot/parrot/commit/8f65204cfc
02:58 dalek Heuristic branch merge: pushed 196 commits to parrot by rurban
03:09 MikeFair sorear: Doesn't seem to work
03:09 MikeFair rule if_expr {
03:09 MikeFair 'if' ~ <?before 'then'> <EXPR>
03:09 MikeFair 'then' [ <statement> [ <statement>* 'end' 'if' ]? || 'end' 'if' ]
03:09 MikeFair oh wait, I still have that first before in there
03:10 * MikeFair tries again
03:10 MikeFair yeah same problem
03:10 MikeFair 'if' <EXPR> 'then' [ <statement> [ <statement>* 'end' 'if' ]? || 'end' 'if' ]
03:11 MikeFair if 1 then say 1; say 2; say 3; doesn't parse
03:11 MikeFair if 1 then say 1; say 2; say 3; end if does
03:11 benabik you want that first to be (if 1 then say 1;) say 2; say 3; ?
03:11 * MikeFair nods
03:12 benabik Why the || 'end' 'if' ?
03:12 MikeFair because sorear said so. :) I think it's explicitly handling the if 1 then end if case
03:12 MikeFair if I read it right
03:13 MikeFair (where there's no <statement> match)
03:13 benabik ah
03:15 MikeFair If you're really curious, the original BNF I'm copying is this:
03:15 MikeFair <ifBlock> =
03:15 MikeFair if <logical> [ <return> ] then {<singleThen> | <return> <multiThen>}
03:16 MikeFair They use 'then' <return> to start a multiThen
03:16 MikeFair and 'then' <statement> to mean singleThen
03:16 MikeFair where <return> = \n
03:16 benabik What about: 'if' <EXPR> 'then' [ <statement>* 'end' 'if' || <statement> ]
03:17 benabik Not terribly efficient, but it should try to match all the statements, then look for an end if, fail to find it then just eat a single statment.
03:17 MikeFair benabik: That's more the approach I was taking, but I don't think that's left factored
03:17 MikeFair but I'll give it a shot
03:18 benabik I think trying to do it without a disambiguator is going to be problematic.  The original says no return = single, return = multi.
03:19 MikeFair 'if' <EXPR> 'then' [ <statement>* 'end' 'if' || <statement> ]
03:19 MikeFair same problem
03:19 benabik There's no similar disambig in your grammar.
03:19 MikeFair if 1 then say 1; say 2; say 3; doesn't parse
03:19 * MikeFair tries using newlines instead
03:19 MikeFair oh that's what I did  hehe
03:20 MikeFair ./installable_safire --target=parse -e 'if 1 then say 1 \n say 2\n say 3'
03:20 benabik Is the if a rule or token?  tokens refuse to backtrack.
03:20 MikeFair rule if_expr
03:21 benabik \n inside single quotes doesn't do what you think, I think.
03:21 MikeFair benabik: Well usually if 1 then say 1; say 2; say 3; end if will parse
03:21 MikeFair let's see
03:21 MikeFair yep
03:22 MikeFair ./installable_safire --target=parse -e 'if 1 then say 1 \n say 2\n say 3\nend if' parses
03:22 MikeFair Syntax error at line 3, near "say 2\nsay "
03:23 benabik MikeFair: '\n' sends \n to the program, not a newline.  You need to use double quotes.
03:23 MikeFair benabik: Oh I'm hitting the <enter> key
03:23 MikeFair not \n
03:23 benabik ah
03:23 MikeFair I just didn't want to take up multiple lines in the channel here
03:24 MikeFair Now this might be a problem with statement
03:24 MikeFair the terminators ; and \n are actually on "statement_list"
03:24 MikeFair <statement>* %[ ';' | '\n']
03:25 MikeFair err not '\n' just \n
03:34 MikeFair ok, that seems to be acting better but I can't seem to make the ; || $$ work
03:35 MikeFair I can get either one of them to work but not a mixture ofthe two...
03:35 MikeFair I get the same results with either \n or $$
03:36 MikeFair <ws> is not including \n
04:21 MikeFair WooHoo!! I have no idea if it's actually matching the right things, and anything complex takes forever to parse, but at least everything I expect to parse parses!
04:22 MikeFair rule if_expr {
04:22 MikeFair 'if' <EXPR> 'then'
04:22 MikeFair [ <statement_list> [ 'end' 'if' || 'else' [ <statement_list> 'end' 'if' || <statement> ] ]
04:22 MikeFair || <statement> ]
04:22 MikeFair }
04:22 * MikeFair heads off to tuck kids into bed.
04:22 MikeFair :)
04:30 bluescreen_ joined #parrot
04:36 eternaleye joined #parrot
04:42 particle joined #parrot
04:44 eternaleye joined #parrot
04:51 benabik joined #parrot
04:51 benabik_ joined #parrot
04:56 MikeFair benabik: wb
05:06 mvorl left #parrot
05:35 fperrad joined #parrot
07:02 brrt joined #parrot
08:09 lucian joined #parrot
08:19 Psyche^ joined #parrot
10:18 eternaleye joined #parrot
10:27 eternaleye joined #parrot
11:21 eternaleye_ joined #parrot
11:38 eternaleye_ joined #parrot
11:43 eternaleye_ joined #parrot
12:30 benabik joined #parrot
12:41 JimmyZ joined #parrot
12:42 mtk joined #parrot
12:51 PacoAir joined #parrot
13:25 bluescreen joined #parrot
14:02 rurban_mobile joined #parrot
14:13 benabik joined #parrot
14:18 nnunley joined #parrot
14:27 rurban_mobile joined #parrot
14:28 dalek parrot/native_pbc2: b99bb67 | rurban++ | / (2 files):
14:28 dalek parrot/native_pbc2: native numbers: document intel bit63
14:28 dalek parrot/native_pbc2: review: https://github.com/parrot/parrot/commit/b99bb67643
14:59 brrt hi #parrot
15:00 dmalcolm joined #parrot
15:06 moritz \o brrt
15:06 brrt \o moritz
15:06 brrt did you perchance ever find out how and if you could load perl6 as a language and a compiler?
15:07 moritz brrt: no. I only found out why it doesn't work right now
15:07 moritz (it only calls compreg in the compiling process, but it doesn't emit code for the compreg)
15:07 moritz I have to bug jnthn about how to fix that
15:08 brrt ok, great, thats good to know :-)
15:11 benabik Hm.  Trying to build with Parrot/NQP/Rakudo master give me an error about not finding the 'os' library.  I thought we installed a compatibility shim for that?
15:11 benabik Sorry, "trying to build Rakudo HEAD with Parrot/NQP HEAD", is more exactly what I meant.
15:44 Coke I know we /talked/ about putting in a shim for that. I don't think I saw a commit (but could have missed it)
15:46 sivoais joined #parrot
16:47 patspam joined #parrot
17:25 benabik joined #parrot
17:32 benabik joined #parrot
17:37 benabik joined #parrot
17:40 benabik joined #parrot
17:42 benabik joined #parrot
17:47 benabik joined #parrot
17:47 dalek parrot/native_pbc2: 4afbef5 | rurban++ | src/packfile/pf_items.c:
17:47 dalek parrot/native_pbc2: pf_items: keep const qualifiers
17:47 dalek parrot/native_pbc2: review: https://github.com/parrot/parrot/commit/4afbef5009
18:00 benabik joined #parrot
18:38 dmalcolm joined #parrot
18:47 rurban_mobile benabik: we already have an empty dynpmc os for the rakudo problem
18:47 benabik rurban_mobile: Except that I tried to build Rakudo and it failed because it couldn't find library 'os'
18:52 lucian joined #parrot
18:57 Coke benabik: how did you build rakudo? pre-installed parrot or with -gen-parrot?
18:57 benabik Pre-installed
18:57 benabik Built Parrot HEAD, NQP HEAD, Rakudo HEAD
18:57 Coke pre-existing older version of parrot installed?
18:59 Coke I do see rurban++'s commit for the backward compat. you at d76bef8 or later?
19:01 benabik yeah
19:01 rurban_mobile Yes, d76bef83f04f62f3e5871a6695526eb600b0d7a2 it was. I forgot to include into the original bdw/move-os branch
19:01 * benabik is at a54a581
19:02 rurban_mobile I'm just rescuing my harddisc from the texan weekend power spike which blew up parts of the disc.
19:13 benabik Exact error (while building the setting): error:imcc:loadlib directive could not find library `os' in file '(file unknown)' line 1
19:19 benabik class &
19:23 rurban_mobile benabik: is there a dynpmc/os?
19:25 rurban_mobile I could imagine that dynpmc/os did not get installed.
19:34 contingencyplan joined #parrot
19:57 Coke benabik: look for the commit that removed it, then the commit that added the stub back, and find the difference.
19:57 Coke rurban++ is probably right about missing something on the install.
20:05 lucian joined #parrot
20:13 rurban_mobile I'll need about a day to recover my system
20:54 benabik joined #parrot
20:58 benabik_ joined #parrot
21:10 lucian joined #parrot
22:14 jlaire joined #parrot
22:43 whiteknight joined #parrot
23:18 GeJ_ joined #parrot
23:18 benabik joined #parrot
23:18 perlite joined #parrot
23:21 patspam joined #parrot
23:27 ingy joined #parrot
23:33 mj41 joined #parrot

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

Parrot | source cross referenced