Skip to content
Permalink
Browse files

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 '>'
  • Loading branch information...
ribbon-otter committed Aug 18, 2018
1 parent 34468f1 commit ec366c30dd053a962fa2325fbab6208caac33fcf
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Perl6/Grammar.nqp
@@ -3688,7 +3688,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
]
| <VALUE=decint>
]
<!!before ['.' <?before \s | ',' | '=' | ':' | <.terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? >
<!!before ['.' <?before \s | ',' | '=' | ':' <!before ['<' <OPER=prefix> '>'] > | <.terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? >
[ <?before '_' '_'+\d> <.sorry: "Only isolated underscores are allowed inside numbers"> ]?
}

0 comments on commit ec366c3

Please sign in to comment.
You can’t perform that action at this time.