Skip to content

Commit

Permalink
Make quit() and exit() work Issue skulpt#36
Browse files Browse the repository at this point in the history
This is Issue 115 in the Google Code repo

I did this as a language change making quit() and exit() flow
statements.

I added a unit test which nicely tests functionality and passes
but the parser and symbol table unit tests are unhappy.   Either
this is a problem in my version of Python or I missed some detail
on a step I needed to take other than regentests after adding a
new unit test.  Thanks in advance for any help/explanation here.
  • Loading branch information
csev committed Jan 23, 2013
1 parent 4d6bce8 commit cf84bbc
Show file tree
Hide file tree
Showing 12 changed files with 1,177 additions and 956 deletions.
129 changes: 67 additions & 62 deletions dist/skulpt.js

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions gen/astnodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ function Return_(/* {expr_ty} */ value, /* {int} */ lineno, /* {int} */
return this;
}

/** @constructor */
function Quit_(/* {expr_ty} */ value, /* {int} */ lineno, /* {int} */
col_offset)
{
this.value = value;
this.lineno = lineno;
this.col_offset = col_offset;
return this;
}

/** @constructor */
function Exit_(/* {expr_ty} */ value, /* {int} */ lineno, /* {int} */
col_offset)
{
this.value = value;
this.lineno = lineno;
this.col_offset = col_offset;
return this;
}

/** @constructor */
function Delete_(/* {asdl_seq *} */ targets, /* {int} */ lineno, /* {int} */
col_offset)
Expand Down Expand Up @@ -750,6 +770,14 @@ Return_.prototype._astname = "Return";
Return_.prototype._fields = [
"value", function(n) { return n.value; }
];
Quit_.prototype._astname = "Quit";
Quit_.prototype._fields = [
"value", function(n) { return n.value; }
];
Exit_.prototype._astname = "Exit";
Exit_.prototype._fields = [
"value", function(n) { return n.value; }
];
Delete_.prototype._astname = "Delete";
Delete_.prototype._fields = [
"targets", function(n) { return n.targets; }
Expand Down
Loading

0 comments on commit cf84bbc

Please sign in to comment.