Skip to content

Commit

Permalink
Properly panic on redeclaration of variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcurtis committed Jul 19, 2010
1 parent 21bbd5c commit 012459d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/tutorial_episode_5.pod
Expand Up @@ -241,7 +241,7 @@ The code to be added to the method statement:sym<var> looks then like this:

if $?BLOCK.symbol( $name ) {
# symbol is already present
$/.panic("Error: symbol " ~ $name ~ " was already defined.\n");
$/.CURSOR.panic("Error: symbol " ~ $name ~ " was already defined.\n");
}
else {
$?BLOCK.symbol( $name, :scope('lexical') );
Expand Down
2 changes: 1 addition & 1 deletion src/Squaak/Actions.pm
Expand Up @@ -241,7 +241,7 @@ method statement:sym<var>($/) {

if $?BLOCK.symbol( $name ) {
# symbol is already present
$/.panic("Error: symbol " ~ $name ~ " was already defined.\n");
$/.CURSOR.panic("Error: symbol " ~ $name ~ " was already defined.\n");
}
else {
$?BLOCK.symbol( $name, :scope('lexical') );
Expand Down

0 comments on commit 012459d

Please sign in to comment.