Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow whitespace before state-variable initializers

  • Loading branch information...
commit 9374d970bfdf0b5e3650be8234b408e2c8f96d7e 1 parent 253de26
@sorear authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/STD.pm6
View
13 src/STD.pm6
@@ -1755,9 +1755,9 @@ grammar P6 is STD {
[
| '\\' <defterm> <.ws>
[ <initializer> || <.sorry("Term definition requires an initializer")> ]
- | <variable_declarator> <initializer>?
+ | <variable_declarator> <.ws><initializer>?
[ <?before <.ws>','<.ws> { @*MEMOS[$¢.pos]<declend> = $*SCOPE; }> ]?
- | '(' ~ ')' <signature> <trait>* <initializer>?
+ | '(' ~ ')' <signature> <trait>* <.ws><initializer>?
| <routine_declarator>
| <regex_declarator>
| <type_declarator>
@@ -2757,6 +2757,7 @@ grammar P6 is STD {
<trait>*
{ $Actions.install_constant($/) }
+ <.ws>
[
|| <initializer>
|| <.sorry: "Missing initializer on constant declaration">
@@ -2764,17 +2765,17 @@ grammar P6 is STD {
}
token initializer:sym<=> {
- <sym> <EXPR(($*LEFTSIGIL eq '$' ?? (item %item_assignment) !! (item %list_prefix) ))>
+ <sym>:s <EXPR(($*LEFTSIGIL eq '$' ?? (item %item_assignment) !! (item %list_prefix) ))>
|| <.panic: "Malformed initializer">
}
token initializer:sym<:=> {
- <sym> <EXPR(item %list_prefix)> || <.panic: "Malformed binding">
+ <sym>:s <EXPR(item %list_prefix)> || <.panic: "Malformed binding">
}
token initializer:sym<::=> {
- <sym> <EXPR(item %list_prefix)> || <.panic: "Malformed binding">
+ <sym>:s <EXPR(item %list_prefix)> || <.panic: "Malformed binding">
}
token initializer:sym<.=> {
- <sym> <dottyopish> || <.panic: "Malformed mutator method call">
+ <sym>:s <dottyopish> || <.panic: "Malformed mutator method call">
}
token type_constraint {
Please sign in to comment.
Something went wrong with that request. Please try again.