From ec366c30dd053a962fa2325fbab6208caac33fcf Mon Sep 17 00:00:00 2001 From: ribbon-otter <39717159+ribbon-otter@users.noreply.github.com> Date: Sat, 18 Aug 2018 12:12:36 -0700 Subject: [PATCH 1/2] Allow prefix calls with .:< ... > on integer literals Fix Github #2094. Before this commit, '42.:<->' would error because the check which prevented integers ending with fullstops was overly aggressive: any time an integer was followed by '.:', an error would be generated. With this commit, an integer followed by '.:' will only error if the next thing after it is not '<' then a prefix operator then '>' --- src/Perl6/Grammar.nqp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp index 2701cfda155..27b8d1c2169 100644 --- a/src/Perl6/Grammar.nqp +++ b/src/Perl6/Grammar.nqp @@ -3688,7 +3688,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD { ] | ] - | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? > + '>'] > | <.terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? > [ <.sorry: "Only isolated underscores are allowed inside numbers"> ]? } From 1835f2806fa1e3dcc6663731d07dbf0d69d7c0ec Mon Sep 17 00:00:00 2001 From: ribbon-otter <39717159+ribbon-otter@users.noreply.github.com> Date: Sun, 26 Aug 2018 09:11:26 -0700 Subject: [PATCH 2/2] Add support for all coloncircumfix in the form 42.:<-> Before only `42.:<->` was permitted. This commit weakens numbers-may-not-end-with-decimal error checking to support `42.:<<->>`, `42.:['-']`, etc to bring it inline with `(42).:['-']`, `(42).:['-']`, etc working. These are the requested changes that AlexDaniel made with regard to my pull request to fix GitHub #2094. --- src/Perl6/Grammar.nqp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp index 27b8d1c2169..d1a4de0ff1f 100644 --- a/src/Perl6/Grammar.nqp +++ b/src/Perl6/Grammar.nqp @@ -3688,7 +3688,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD { ] | ] - '>'] > | <.terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? > + > > | <.terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? > [ <.sorry: "Only isolated underscores are allowed inside numbers"> ]? }