Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add support for empty array/hash literals.
  • Loading branch information
tcurtis committed Jul 20, 2010
1 parent ff85503 commit 4f03fca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/tutorial_episode_8.pod
Expand Up @@ -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<[ ]> {
'[' <EXPR> ** ',' ']'
'[' [<EXPR> ** ',']? ']'
}

Some examples are shown below:
Expand All @@ -60,7 +60,7 @@ constructed through a hashtable constructor. The syntax for this is expressed
below:

rule circumfix:sym<{ }> {
'{' <named_field> ** ',' '}'
'{' [<named_field> ** ',']? '}'
}

rule named_field {
Expand Down
4 changes: 2 additions & 2 deletions src/Squaak/Grammar.pm
Expand Up @@ -164,11 +164,11 @@ INIT {
token circumfix:sym<( )> { '(' <.ws> <EXPR> ')' }

rule circumfix:sym<[ ]> {
'[' <EXPR> ** ',' ']'
'[' [<EXPR> ** ',']? ']'
}

rule circumfix:sym<{ }> {
'{' <named_field> ** ',' '}'
'{' [<named_field> ** ',']? '}'
}

rule named_field {
Expand Down

0 comments on commit 4f03fca

Please sign in to comment.