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

No warning for non-octal numbers starting with 0 in Rakudo #2300

Closed
p6rt opened this issue Dec 19, 2010 · 10 comments
Closed

No warning for non-octal numbers starting with 0 in Rakudo #2300

p6rt opened this issue Dec 19, 2010 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 19, 2010

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

Searchable as RT80982$

@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

From @bbkr

[18​:05] <bbkr> std​: 01
[18​:05] <p6eval> std 32123​: OUTPUT«Potential difficulties​:â�¤ Leading 0 does
not indicate octal in Perl 6; please use 0o1 if you mean that
at /tmp/PdH_Z5X50c line 1​:â�¤------> �[32m01�[33mâ���[31m<EOL>�[0mâ�¤ok 00​:01
114m�»

[18​:05] <bbkr> rakudo​: 01
[18​:05] <p6eval> rakudo dc9900​: ( no output )

@p6rt
Copy link
Author

p6rt commented Dec 19, 2010

From @masak

<masak> rakudo​: say 01234
<p6eval> rakudo 96d7e0​: OUTPUT«1234â�¤Â»
* masak submits rakudobug
<moritz_> std​: 01234
<p6eval> std 625303c​: OUTPUT«Potential difficulties​:â�¤ Leading 0 does
not indicate octal in Perl 6; please use 0o1234 if you mean that [...]
ok 00​:01 118mâ�¤Â»
<masak> right.
<flussence> rakudo​: say 0o1234
<p6eval> rakudo 96d7e0​: OUTPUT«668â�¤Â»
<moritz_> masak​: it should warn, but the outcome is OK
<masak> moritz_​: nod.

@p6rt
Copy link
Author

p6rt commented Dec 23, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in integration/error-reporting.t

commit eb032c702f08195650b08a5235ba4cd5a8585a89
Author​: Kyle Hasselbacher <kyleha@​gmail.com>
Date​: Thu Dec 23 10​:07​:58 2010 -0600

  [error-reporting.t] Add test for RT #​80982

Inline Patch
diff --git a/integration/error-reporting.t b/integration/error-reporting.t
index 4b97913..5d63d01 100644
--- a/integration/error-reporting.t
+++ b/integration/error-reporting.t
@@ -62,4 +62,12 @@ A.new.x(42);',
         err     => rx/'line 3'>>/,
     }, 'got the right line number for accessors';
 
+# RT #80982
+is_run 'say 0080982',
+    {
+        status => 0,
+        out => "80982\n",
+        err => rx/ octal /,
+    }, 'use of leading zero causes warning about octal';
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Dec 23, 2010

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

@p6rt
Copy link
Author

p6rt commented Jan 5, 2011

From @tadzik

Patch attached.

Kind regards,
Ted

@p6rt
Copy link
Author

p6rt commented Jan 5, 2011

From @tadzik

0001-Warn-about-leading-0-not-meaning-octal-in-Perl6-fixe.patch
From e74c36f7b7ef1a41a7b70278edf67476d3584cf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tadeusz=20So=C5=9Bnierz?= <tadzikes@gmail.com>
Date: Thu, 6 Jan 2011 00:09:22 +0100
Subject: [PATCH] Warn about leading 0 not meaning octal in Perl6, fixes RT #80982

---
 src/Perl6/Grammar.pm |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/Perl6/Grammar.pm b/src/Perl6/Grammar.pm
index 5f0c8b2..77e1237 100644
--- a/src/Perl6/Grammar.pm
+++ b/src/Perl6/Grammar.pm
@@ -1326,6 +1326,8 @@ token number:sym<numish>   { <numish> }
 
 token numish {
     [
+    # TODO: Should be <.worry()>
+    | 0 <integer> <.panic('Leading 0 does not indicate octal in Perl 6; please use leading 0o if you mean that')>
     | <dec_number>
     | <integer>
     | <rad_number>
-- 
1.7.2.2

@p6rt
Copy link
Author

p6rt commented Jun 30, 2012

From @coke

Merged tickets.

--
Will "Coke" Coleda

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 30, 2012

From @coke

Merged tickets.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Mar 9, 2013

From @jnthn

On Wed Sep 01 09​:09​:03 2010, pawel.pabian@​implix.com wrote​:

[18​:05] <bbkr> std​: 01
[18​:05] <p6eval> std 32123​: OUTPUT«Potential difficulties​:â�¤ Leading
0 does
not indicate octal in Perl 6; please use 0o1 if you mean that
at /tmp/PdH_Z5X50c line 1​:â�¤------> �[32m01�[33mâ���[31m<EOL>�[0mâ�¤ok 00​:01
114m�»

[18​:05] <bbkr> rakudo​: 01
[18​:05] <p6eval> rakudo dc9900​: ( no output )

It warns now, and enabled the test for it too, so resolving.

Thanks!

Jonathan

@p6rt
Copy link
Author

p6rt commented Mar 9, 2013

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

@p6rt p6rt closed this as completed Mar 9, 2013
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant