Skip to content

Commit

Permalink
Allow prefix calls with .:< ... > on integer literals
Browse files Browse the repository at this point in the history
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 ec366c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -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"> ]?
}
Expand Down

0 comments on commit ec366c3

Please sign in to comment.