aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2014-10-20 18:12:13 +0300
committerMihai Bazon <mihai@bazon.net>2014-10-20 18:12:13 +0300
commitf36a1eaa8b5203ab7e4616108c33a0b68668a8db (patch)
tree3a869f736a04317d44ea6b699ec92b52620625e6 /lib
parenta64bdda9ae42ff39543fcfe16d70c4e064780e92 (diff)
downloadtracifyjs-f36a1eaa8b5203ab7e4616108c33a0b68668a8db.tar.gz
tracifyjs-f36a1eaa8b5203ab7e4616108c33a0b68668a8db.zip
Add option to allow return outside of functions.
Close #288
Diffstat (limited to 'lib')
-rw-r--r--lib/parse.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/parse.js b/lib/parse.js
index de982b1e..931e5f66 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -609,6 +609,7 @@ function parse($TEXT, options) {
toplevel : null,
expression : false,
html5_comments : true,
+ bare_returns : false,
});
var S = {
@@ -788,7 +789,7 @@ function parse($TEXT, options) {
return if_();
case "return":
- if (S.in_function == 0)
+ if (S.in_function == 0 && !options.bare_returns)
croak("'return' outside of function");
return new AST_Return({
value: ( is("punc", ";")
/span>gnu: php: Update to 7.3.8....* gnu/packages/php.scm (php): Update to 7.3.8. [inputs]: Use pcre2/fixed. Tobias Geerinckx-Rice 2019-08-02gnu: php: Don't use NAME in source URI....* gnu/packages/php.scm (php)[source]: Hard-code NAME. Tobias Geerinckx-Rice 2019-05-31gnu: php: Update to 7.3.6....* gnu/packages/php.scm (php): Update to 7.3.6. Julien Lepiller 2019-05-02gnu: php: Update to 7.3.5....* gnu/packages/php.scm (php): Update to 7.3.5. Julien Lepiller 2019-05-01gnu: php: Disable failing tests on armhf....* gnu/packages/php.scm (php)[arguments]: Disable two failing tests on armhf. Julien Lepiller 2019-04-04gnu: php: Update to 7.3.4....* gnu/packages/php.scm (php): Update to 7.3.4. Julien Lepiller 2019-03-29gnu: php: Fix typo....Regression introduced in e8cfce439afed945e352ad28f73f0a5f7840f503. * gnu/packages/php.scm (php)[arguments]: Add missing 'else' branch of the 'if'. Change first argument to 'string-prefix?' to match GNU triplets as well. Ludovic Courtès 2019-03-28gnu: php: Disable failing tests on armhf....* gnu/packages/php.scm (php)[arguments]: Disable failing tests on armhf. Julien Lepiller