Skip to content

Conversation

tbrowder
Copy link
Member

No description provided.

@zoffixznet
Copy link
Contributor

zoffixznet commented Jun 21, 2016

👎 I'm working on fixing this bug ATM (I hit a snag and it won't be fixed until tomorrow, though).

@tbrowder tbrowder merged commit 4c4d0e2 into Raku:master Jun 21, 2016
@tbrowder
Copy link
Member Author

On Mon, Jun 20, 2016 at 7:49 PM, Zoffix Znet notifications@github.com wrote:

I'm working on fixing this bug ATM.

I've discussed the bug with Patrick Michaud here at TPC::NA::2016, and
he will help me debug it. Shall I stop my efforts?

-Tom

P.S. I still think the PR should go ahead--no telling how long the
fix will take. And my temp fix is usable and better looking without
the backslashes.

@tbrowder tbrowder deleted the p6-opt-table branch June 21, 2016 01:04
@zoffixznet
Copy link
Contributor

zoffixznet commented Jun 21, 2016

Shall I stop my efforts?

No, @pmichaud's help would be appreciated. I'm well out of my depth. Please work with Patrick to try to rectify this.

Here's how far I got and the issues I'm still facing:

1.

I managed to fix the original RT#128221 with the following changes, but the fix is not enough (note: just the first change may be all that's needed):

zoffix@VirtualBox:~/CPANPRC/rakudo$ gd
diff --git a/src/Perl6/Pod.nqp b/src/Perl6/Pod.nqp
index 5e19e83..f4eb268 100644
--- a/src/Perl6/Pod.nqp
+++ b/src/Perl6/Pod.nqp
@@ -279,7 +279,9 @@ class Perl6::Pod {
         $i := 0;
         while $i < +@rows {
             my $v := @rows[$i];
-            if $v ~~ /^'='+ || ^'-'+ || ^'_'+ || ^\h*$/ {
+            if $v ~~ /^
+                [ <[=\h+|]>+ | <[-\h+|]>+ | <[_\h+|]>+ | <[\h+|]>+ ]
+            $/ {
                 @res[$i] := $v;
             } elsif $v ~~ /\h'|'\h/ {
                 my $m := $v ~~ /
@@ -409,7 +411,9 @@ class Perl6::Pod {

         my $i := 0;
         while $i < +@rows {
-            unless @rows[$i] ~~ /^'='+ || ^'-'+ || ^'_'+ || ^\h*$ / {
+            unless @rows[$i] ~~ /^
+                [ <[=\h+|]>+ | <[-\h+|]>+ | <[_\h+|]>+ | <[\h+|]>+ ]
+            $/ {
                 my @line := nqp::split('', @rows[$i]);
                 my $j := 0;
                 while $j < +@line {
@@ -459,7 +463,9 @@ class Perl6::Pod {

         my @ret := [];
         for @rows -> $row {
-            if $row ~~ /^'='+ || ^'-'+ || ^'_'+ || ^\h*$/ {
+            if $row ~~ /^
+                [ <[=\h+|]>+ | <[-\h+|]>+ | <[_\h+|]>+ | <[\h+|]>+ ]
+            $/ {
                 @ret.push($row);
                 next;
             }
zoffix@VirtualBox:~/CPANPRC/rakudo$ 

2.

However, the test in roast for this bug is poor. Here's my version:

=begin table
-Col 1 | -Col 2 | _Col 3 | =Col 4
=======+========+========+=======
Col 1  | -Col 2 | _Col 3 | =Col 4
-------|--------|--------|-------
Col 1  | -Col 2 | _Col 3 | =Col 4
Col 1  | -Col 2 | _Col 3 | =Col 4
 Col 1 | -Col 2 | _Col 3 | =Col 4
Col 1  | -Col 2 | _Col 3 | =Col 4
Col 1  | -Col 2 | _Col 3 | =Col 4
-------|--------|--------|-------
Col  1 | Col 2  |  Col 3 |  Col 4
=end table

And it parses like this. As you can see the columns' contents are broken:

headers =>
["Col 1", "-Col 2", "_Col 3", "=Col 4"],

contents => [
    ["ol 1", "-Col 2", "_Col 3", "=Col 4"],
    [
        "ol 1 ol 1 Col 1 ol 1 ol 1",
        "-Col 2 -Col 2 -Col 2 -Col 2 -Col 2",
        "_Col 3 _Col 3 _Col 3 _Col 3 _Col 3",
        "=Col 4 =Col 4 =Col 4 =Col 4 =Col 4"
    ],
    ["ol 1", "Col 2", "Col 3", "Col 4"]
]

If you and pmchaud can fix this, that would be great :) Thanks.

@tbrowder
Copy link
Member Author

On Monday, June 20, 2016, Zoffix Znet notifications@github.com wrote:

Shall I stop my efforts?

No, @pmichaud https://github.com/pmichaud's help would be appreciated.
I'm well out of my depth. Please work with Patrick to try to rectify this.

Here's how far I got and the issues I'm still facing:

Looks like you've made a great start! Do you have Patrick's e-mail address?

-Tom

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

Successfully merging this pull request may close these issues.

2 participants