diff --git a/doc/tutorial_episode_8.pod b/doc/tutorial_episode_8.pod index 1cc3a48..7cdd24e 100644 --- a/doc/tutorial_episode_8.pod +++ b/doc/tutorial_episode_8.pod @@ -38,7 +38,7 @@ that can be assigned to variables, you can have array literals. Below is the grammar rule for this: rule circumfix:sym<[ ]> { - '[' ** ',' ']' + '[' [ ** ',']? ']' } Some examples are shown below: @@ -60,7 +60,7 @@ constructed through a hashtable constructor. The syntax for this is expressed below: rule circumfix:sym<{ }> { - '{' ** ',' '}' + '{' [ ** ',']? '}' } rule named_field { diff --git a/src/Squaak/Grammar.pm b/src/Squaak/Grammar.pm index 254b0ba..2d703c2 100644 --- a/src/Squaak/Grammar.pm +++ b/src/Squaak/Grammar.pm @@ -164,11 +164,11 @@ INIT { token circumfix:sym<( )> { '(' <.ws> ')' } rule circumfix:sym<[ ]> { - '[' ** ',' ']' + '[' [ ** ',']? ']' } rule circumfix:sym<{ }> { - '{' ** ',' '}' + '{' [ ** ',']? '}' } rule named_field {