From 1bf5928b5485db5646515919672e005738d6df81 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Mon, 3 Sep 2012 10:26:23 +0300 Subject: Reverting "minor perf. improvements" Revert "minor perf. improvements" This reverts commit 24bfd55a22afd791d4a97694641831cfbd27fb14. broke the parser somehow; too early to optimize, let's get the other stuff running. --- lib/parse.js | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'lib/parse.js') diff --git a/lib/parse.js b/lib/parse.js index d6893253..416c363a 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -748,7 +748,7 @@ function parse($TEXT, exigent_mode) { function parenthesised() { expect("("); - var exp = expression(true); + var exp = expression(); expect(")"); return exp; }; @@ -756,7 +756,7 @@ function parse($TEXT, exigent_mode) { function embed_tokens(parser) { return function() { var start = S.token; - var expr = parser(); + var expr = parser.apply(this, arguments); var end = prev(); expr.start = start; expr.end = end; @@ -933,9 +933,9 @@ function parse($TEXT, exigent_mode) { function regular_for(init) { expect(";"); - var test = is("punc", ";") ? null : expression(true); + var test = is("punc", ";") ? null : expression(); expect(";"); - var step = is("punc", ")") ? null : expression(true); + var step = is("punc", ")") ? null : expression(); expect(")"); return new AST_For({ init : init, @@ -947,7 +947,7 @@ function parse($TEXT, exigent_mode) { function for_in(init) { var lhs = init instanceof AST_Var ? init.definitions[0].name : null; - var obj = expression(true); + var obj = expression(); expect(")"); return new AST_ForIn({ init : init, @@ -957,20 +957,6 @@ function parse($TEXT, exigent_mode) { }); }; - var function_body = embed_tokens(function(){ - ++S.in_function; - var loop = S.in_loop; - var labels = S.labels; - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - var a = block_(true); - --S.in_function; - S.in_loop = loop; - S.labels = labels; - return a; - }); - var function_ = function(in_statement) { var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun @@ -989,7 +975,19 @@ function parse($TEXT, exigent_mode) { next(); return a; })(true, []), - body: function_body() + body: embed_tokens(function(){ + ++S.in_function; + var loop = S.in_loop; + var labels = S.labels; + S.in_directives = true; + S.in_loop = 0; + S.labels = []; + var a = block_(true); + --S.in_function; + S.in_loop = loop; + S.labels = labels; + return a; + })() }); }; @@ -1034,7 +1032,7 @@ function parse($TEXT, exigent_mode) { cur = []; branch = new AST_Case({ start : prog1(S.token, next), - expression : expression(true), + expression : expression(), body : cur }); a.push(branch); @@ -1189,7 +1187,7 @@ function parse($TEXT, exigent_mode) { switch (start.value) { case "(": next(); - var ex = expression(true); + var ex = expression(); ex.start = start; ex.end = S.token; expect(")"); @@ -1333,7 +1331,7 @@ function parse($TEXT, exigent_mode) { } if (is("punc", "[")) { next(); - var prop = expression(true); + var prop = expression(); expect("]"); return subscripts(new AST_Sub({ start : start, @@ -1453,6 +1451,8 @@ function parse($TEXT, exigent_mode) { }; var expression = function(commas, no_in) { + if (arguments.length == 0) + commas = true; var start = S.token; var expr = maybe_assign(no_in); if (commas && is("punc", ",")) { -- cgit v1.2.3 , the user can just add the package to the profile and things will just work. I feel that leaving this alone is cleaner than trying to fix the dependency (if we want to keep it, it needs to be in propagated-inputs in order to keep Git around; I stumbled upon this building a project with Git dependencies after doing a `guix gc`. However, given that using Git dependencies is the exception and I think that minimizing dependencies is nicer I opted to just remove the substition completely). * gnu/packages/elixir.scm (elixir)[arguments]: In 'replace-paths' phase, remove substitutions of "git". Co-authored-by: Ludovic Courtès <ludo@gnu.org> Cees de Groot 2022-02-14gnu: elixir: Fix regex for ERTS_BIN substitution....* gnu/packages/elixir.scm (elixir)[arguments]: In 'replace-paths' phase, change "ERTS_BIN" regexp. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Cees de Groot 2022-02-14gnu: elixir: Fix file name argument to 'search-input-file'....Reported by John Hamelink <me@johnhame.link> and Cees de Groot <cg@evrl.com>. Regression introduced in 3da297997dad5b3525277fcecdca84f01d45b104. * gnu/packages/elixir.scm (elixir)[arguments]: In 'replace-paths' phase, search for "/bin/sh", not "sh". Ludovic Courtès 2022-01-28gnu: elixir: Use G-expressions....* gnu/packages/elixir.scm (elixir)[arguments]: Use G-expressions. Prefer SEARCH-INPUT-FILES over WHICH. Nicolas Goaziou 2022-01-28gnu: elixir: Update to 1.13.2....* gnu/packages/elixir.scm (elixi): Update to 1.13.2. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Cees de Groot 2021-12-13gnu: Simplify package inputs....This commit was obtained by running: ./pre-inst-env guix style without any additional argument. Ludovic Courtès 2021-10-14gnu: elixir: Update to 1.12.3....* gnu/packages/elixir.scm (elixir): Update to 1.12.3. [arguments]: Don't explicitly return #t from phases. Tobias Geerinckx-Rice 2021-09-21gnu: elixir: Update to 1.12.2....* gnu/packages/elixir.scm (elixir): Update to 1.12.2. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Cees de Groot 2021-07-13gnu: elixir: Update to 1.12.0....* gnu/packages/elixir.scm (elixir): Update to 1.12.0. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Cees de Groot