Skip to content

Commit d23d356

Browse files
committed
Back out incomplete ESM support for 3.0.0
This is incomplete, and it looks like we might just switch to only generating ES6 code with ESM modules. We need to resolve how the JS demo on the website is built first though.
1 parent ff42274 commit d23d356

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ $(go_src_dir)/%_stemmer.go: algorithms/%.sbl snowball$(EXEEXT)
332332

333333
$(js_output_dir)/%-stemmer.js: algorithms/%.sbl snowball$(EXEEXT)
334334
@mkdir -p $(js_output_dir)
335-
./snowball $< -js="$(JSTYPE)" -o "$(js_output_dir)/$*-stemmer"
335+
./snowball $< -js -o "$(js_output_dir)/$*-stemmer"
336336

337337
$(js_output_dir)/base-stemmer.js: $(js_runtime_dir)/base-stemmer.js
338338
@mkdir -p $(js_output_dir)

NEWS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ Javascript
178178
`/usr/bin/nodejs` because `/usr/bin/node` was already in use by a
179179
completely different package, but that has since changed).
180180

181-
+ Add start of ESM support. See #183, reported by Lionel Rowe.
182-
183181
Pascal
184182
------
185183

compiler/driver.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ static int eq(const char * s1, const char * s2) {
2828
return strcmp(s1, s2) == 0;
2929
}
3030

31-
static int startswith(const char * s1, const char * s2) {
32-
return strncmp(s1, s2, strlen(s2)) == 0;
33-
}
34-
3531
static void print_arglist(int exit_code) {
3632
FILE * f = exit_code ? stderr : stdout;
3733
fprintf(f, "Usage: snowball SOURCE_FILE... [OPTIONS]\n\n"
@@ -53,8 +49,7 @@ static void print_arglist(int exit_code) {
5349
" -py, -python\n"
5450
#endif
5551
#ifndef DISABLE_JS
56-
" -js[=TYPE] generate Javascript (TYPE values:\n"
57-
" esm global, default: global)\n"
52+
" -js generate Javascript\n"
5853
#endif
5954
#ifndef DISABLE_RUST
6055
" -rust\n"
@@ -170,17 +165,6 @@ static int read_options(struct options * o, int argc, char * argv[]) {
170165
o->js_esm = false;
171166
continue;
172167
}
173-
if (startswith(s, "-js=")) {
174-
o->make_lang = LANG_JAVASCRIPT;
175-
if (eq(s + 4, "global")) {
176-
o->js_esm = false;
177-
} else if (eq(s + 4, "esm")) {
178-
o->js_esm = true;
179-
} else {
180-
fprintf(stderr, "Unknown Javascript type '%s'\n", s + 4);
181-
}
182-
continue;
183-
}
184168
#endif
185169
#ifndef DISABLE_RUST
186170
if (eq(s, "-rust")) {

0 commit comments

Comments
 (0)