Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Locale parsing seems broken on Linux for non-en locales #976

Closed
ludoo opened this Issue · 2 comments

2 participants

@ludoo

Trying to compile for the it_IT locale on Linux gives me this

LC_NUMERIC=it_IT locale -ck LC_NUMERIC | node src/locale.js src/core/format-locale.js > src/core/format-it_IT.js
./node_modules/uglify-js/bin/uglifyjs d3.core.js.tmp -b indent-level=2 -o d3.core.js
WARN: ERROR: Unexpected token: string () [d3.core.js.tmp:2,37]

/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:199
    throw new JS_Parse_Error(message, line, col, pos);
          ^
Error
    at new JS_Parse_Error (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:185:18)
    at js_error (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:199:11)
    at croak (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:630:9)
    at token_error (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:638:9)
    at unexpected (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:644:9)
    at semicolon (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:664:43)
    at /home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:788:38
    at /home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:677:24
    at /home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:1392:23
    at Object.parse (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:1402:7)
make: *** [d3.core.js] Error 1
rm src/core/format-it_IT.js```

LC_NUMERIC=it_IT locale -ck LC_NUMERIC gives

LC_NUMERIC
decimal_point=","
thousands_sep=""
grouping=-1;-1
numeric-decimal-point-wc=44
numeric-thousands-sep-wc=0
numeric-codeset="UTF-8"
@mbostock
Owner

Are you running the official released 3.0.0 (including commit a2753ee)?

@ludoo

Yes, I tried again with a fresh clone:

/-(ludo@lancre)-(14/pts)-(10:48:14:Sat Dec 29)--
\-($:~/tmp/d3)-- git describe
v3.0.1
/-(ludo@lancre)-(15/pts)-(10:49:18:Sat Dec 29)--
\-($:~/tmp/d3)-- LOCALE=it_IT NODE_PATH=./node_modules make
LC_NUMERIC=it_IT locale -ck LC_NUMERIC | node src/locale.js src/core/format-locale.js > src/core/format-it_IT.js
./node_modules/uglify-js/bin/uglifyjs d3.core.js.tmp -b indent-level=2 -o d3.core.js
WARN: ERROR: Unexpected token: string () [d3.core.js.tmp:2,37]

/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:199
    throw new JS_Parse_Error(message, line, col, pos);
          ^
Error
    at new JS_Parse_Error (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:185:18)
    at js_error (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:199:11)
    at croak (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:630:9)
    at token_error (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:638:9)
    at unexpected (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:644:9)
    at semicolon (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:664:43)
    at /home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:788:38
    at /home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:677:24
    at /home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:1392:23
    at Object.parse (/home/ludo/tmp/d3/node_modules/uglify-js/lib/parse.js:1402:7)
make: *** [d3.core.js] Error 1
rm src/core/format-it_IT.js
@mbostock mbostock closed this issue from a commit
@jasondavies jasondavies Fix locale generation on Linux.
The regexp was not unquoting the empty string surrounded by quotes.

Fixes #976.
63979e2
@mbostock mbostock closed this in 63979e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.