Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel dispatch with guillemot doesn't work in modules #1793

Closed
p6rt opened this issue May 29, 2010 · 6 comments
Closed

parallel dispatch with guillemot doesn't work in modules #1793

p6rt opened this issue May 29, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented May 29, 2010

Migrated from rt.perl.org#75434 (status was 'resolved')

Searchable as RT75434$

@p6rt
Copy link
Author

p6rt commented May 29, 2010

From @moritz

Works fine in mainline code​:

18​:26 <@​moritz_> rakudo​: say <a b c>».uc
18​:26 < p6eval> rakudo bbb336​: OUTPUT«ABC␤»

but

# file Foo.pm​:
module Foo;
sub f is export {
  <a b c>».uc;
}

# and then on the command line​:

./perl6 -e 'use Foo; f()'
Unable to parse blockoid, couldn't find final '}' at line 3
current instr.​: 'perl6;Regex;Cursor;FAILGOAL' pc 1989
(ext/nqp-rx/src/stage0/Regex-s0.pir​:1052)
called from Sub 'perl6;Perl6;Grammar;blockoid' pc 60338
(src/gen/perl6-grammar.pir​:4918)
called from Sub 'perl6;Perl6;Grammar;routine_def' pc 123838
(src/gen/perl6-grammar.pir​:21493)
called from Sub 'perl6;Perl6;Grammar;routine_declarator​:sym<sub>' pc
122677 (src/gen/perl6-grammar.pir​:21256)

+ plus a rather long backtrace.

(Same for loading the module from another script file, the -e isn't
crucial for the bug to appear).

@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

From @jnthn

On Sat May 29 09​:31​:36 2010, moritz wrote​:

Works fine in mainline code​:

18​:26 <@​moritz_> rakudo​: say <a b c>».uc
18​:26 < p6eval> rakudo bbb336​: OUTPUT«ABC␤»

but

# file Foo.pm​:
module Foo;
sub f is export {
<a b c>».uc;
}

# and then on the command line​:

./perl6 -e 'use Foo; f()'
Unable to parse blockoid, couldn't find final '}' at line 3
current instr.​: 'perl6;Regex;Cursor;FAILGOAL' pc 1989
(ext/nqp-rx/src/stage0/Regex-s0.pir​:1052)
called from Sub 'perl6;Perl6;Grammar;blockoid' pc 60338
(src/gen/perl6-grammar.pir​:4918)
called from Sub 'perl6;Perl6;Grammar;routine_def' pc 123838
(src/gen/perl6-grammar.pir​:21493)
called from Sub 'perl6;Perl6;Grammar;routine_declarator​:sym<sub>' pc
122677 (src/gen/perl6-grammar.pir​:21256)

+ plus a rather long backtrace.

(Same for loading the module from another script file, the -e isn't
crucial for the bug to appear).

Oh noes! Turns out this was just because we weren't setting the file
handle to read UTF-8 before loading the module. Fixed that, and it works
now. Given to you, dear submitter, for spectesting.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

From @moritz

On Sat Jun 05 18​:06​:22 2010, jnthn@​jnthn.net wrote​:

Oh noes! Turns out this was just because we weren't setting the file
handle to read UTF-8 before loading the module. Fixed that, and it works
now.

\o/

Given to you, dear submitter, for spectesting.

Now that's unfair, all the other submitters don't have to write their
own tests... :-)

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jun 6, 2010
@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in at least one of these files​: t/spec/S12-methods/parallel-dispatch.t, t/spec/packages/ContainsUnicode.pm

commit 9b5d136c93293e3dd9e66bc7395f1960ee26b229
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Jun 6 09​:27​:54 2010 +0000

  [t/spec] test for RT #​75434, guillemot not parsed in modules
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31144 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S12-methods/parallel-dispatch.t b/t/spec/S12-methods/parallel-dispatch.t
index 4948bd3..32ece93 100644
--- a/t/spec/S12-methods/parallel-dispatch.t
+++ b/t/spec/S12-methods/parallel-dispatch.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 38;
+plan 39;
 
 # L<S12/"Parallel dispatch"/"Any of the method call forms may be turned into a hyperoperator">
 # syn r14547
@@ -124,4 +124,12 @@ class Bar is Foo {
         '3|6', '>>.<a>';
 }
 
+{
+    BEGIN { @*INC.push: 't/spec/packages' };
+    use ContainsUnicode;
+    is uc-and-join('foo', 'bar'), 'FOO, BAR',
+        'parallel dispatch with » works in modules too';
+
+}
+
 # vim: ft=perl6
diff --git a/t/spec/packages/ContainsUnicode.pm b/t/spec/packages/ContainsUnicode.pm
new file mode 100644
index 0000000..1f3c25c
--- /dev/null
+++ b/t/spec/packages/ContainsUnicode.pm
@@ -0,0 +1,7 @@
+module ContainsUnicode {
+    sub uc-and-join(*@things, :$separator = ', ') is export {
+        @things».uc.join($separator)
+    }
+}
+
+# vim: ft=perl6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant