Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict Mode #46

Closed
rgaiacs opened this issue Jul 26, 2015 · 3 comments
Closed

Strict Mode #46

rgaiacs opened this issue Jul 26, 2015 · 3 comments
Labels

Comments

@rgaiacs
Copy link
Collaborator

rgaiacs commented Jul 26, 2015

$ git log HEAD -1
commit 71f92bc764761fb69db8030e5d548ddcc83d98ca
Author: Frédéric Wang <fred.wang@free.fr>
Date:   Sun May 31 12:59:01 2015 +0200

    Travis: Just run "make build" without testing for now...
$ texzilla
/usr/local/lib/texzilla-js/TeXZilla.js:876
        function lex() {
        ^^^^^^^^
SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:124:16)
    at node.js:842:3
$ node --version
v0.11.14
@rgaiacs rgaiacs added the bug label Jul 26, 2015
@rgaiacs
Copy link
Collaborator Author

rgaiacs commented Oct 10, 2015

@fred-wang Could you help with this?

$ git rev-parse HEAD
589f5c6c804f8a15a9dc3655f62967148bf55b3c
$ git clean -fxd
$ ./configure 
checking for bash... /bin/bash
checking for closure-compiler... no
checking for nodejs... nodejs
checking for curl... curl
checking for egrep... egrep
checking for git... git
checking for jison... jison
checking for kill... kill
checking for make... make
checking for npm... npm
checking for pkill... pkill
checking for python... python
checking for sed... sed
checking for xsltproc... xsltproc
configure: creating ./config.status
config.status: creating Makefile
$ make build
curl http://www.w3.org/2003/entities/2007xml/unicode.xml -o unicode.xml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8010k  100 8010k    0     0   187k      0  0:00:42  0:00:42 --:--:-- 96194
xsltproc extractChars.xsl unicode.xml > chars.txt
python generateCharCommands.py chars.txt char-commands.txt;
cat char-commands.txt base-commands.txt | egrep -v "^#" | \
sort --reverse --field-separator='"' --key=2,2 > commands.txt
cat main.jisonlex commands.txt > TeXZilla.jisonlex
echo "[\uD800-\uDBFF] return \"HIGH_SURROGATE\";" >> TeXZilla.jisonlex
echo "[\uDC00-\uDFFF] return \"LOW_SURROGATE\";" >> TeXZilla.jisonlex
echo ". return \"BMP_CHARACTER\";" >> TeXZilla.jisonlex
Generating the parser, this may take some time...
jison --outfile TeXZilla-web.js --module-type js --parser-type lalr TeXZilla.jison TeXZilla.jisonlex
sed -i "s|\\\\b)/|)/|g" TeXZilla-web.js # jison issue 204
sed -i "s|var TeXZillaWeb =|var TeXZilla =|" TeXZilla-web.js
sed -i "/typeof this.yy.parseError === 'function'/i this.parseError = parseError;" TeXZilla-web.js
sed -i "/typeof this.yy.parseError === 'function'/,/}"$"/d" TeXZilla-web.js
sed -i "1 i \"use strict\";" TeXZilla-web.js
cat MPL-header.js TeXZilla-web.js >> tmp.js
mv tmp.js TeXZilla-web.js
cp TeXZilla-web.js TeXZilla.js
sed "1,6d" commonJS.js >> TeXZilla.js
$ ./npmbin.sh 
/home/raniere/src/TeXZilla/TeXZilla.js:876
        function lex() {
        ^^^^^^^^
SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function.
    at exports.runInThisContext (vm.js:75:16)
    at Module._compile (module.js:445:25)
    at Object.Module._extensions..js (module.js:480:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:503:10)
    at startup (node.js:132:16)
    at node.js:817:3

@rgaiacs
Copy link
Collaborator Author

rgaiacs commented Oct 10, 2015

Previous reported upstream at zaach/jison#285. =(

@fred-wang
Copy link
Owner

zaach/jison#285 (comment) seems to say that this is fixed. Can you check again?

@rgaiacs rgaiacs closed this as completed Sep 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants