diff --git a/Makefile b/Makefile
index 6f9840a..f03570b 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,8 @@ PARSER_OUT_FILE_NEW = $(LIB_DIR)/parser.js.new
BROWSER_FILE_DEV = $(BROWSER_DIR)/peg-$(PEGJS_VERSION).js
BROWSER_FILE_MIN = $(BROWSER_DIR)/peg-$(PEGJS_VERSION).min.js
-SPEC_SERVER_FILE = $(SPEC_DIR)/server
+SPEC_SERVER_FILE = $(SPEC_DIR)/server
+BENCHMARK_SERVER_FILE = $(BENCHMARK_DIR)/server
VERSION_FILE = VERSION
@@ -108,6 +109,7 @@ lint:
$(SPEC_SERVER_FILE) \
$(BENCHMARK_DIR)/*.js \
$(BENCHMARK_RUN) \
+ $(BENCHMARK_SERVER_FILE) \
$(PEGJS)
.PHONY: all parser browser browserclean spec benchmark lint
diff --git a/benchmark/.eslintrc.json b/benchmark/.eslintrc.json
new file mode 100644
index 0000000..e84df8c
--- /dev/null
+++ b/benchmark/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "env": {
+ "commonjs": true
+ }
+}
diff --git a/benchmark/README.md b/benchmark/README.md
index 9b1bc1b..37bfded 100644
--- a/benchmark/README.md
+++ b/benchmark/README.md
@@ -39,18 +39,12 @@ All commands in the following steps need to be executed in PEG.js root directory
$ npm install
```
- 3. Build browser version of PEG.js:
+ 3. Serve the benchmark suite using a web server:
```console
- $ make browser
+ $ benchmark/server
```
- 4. Serve PEG.js root directory using a web server:
+ 4. Point your browser to the [benchmark suite](http://localhost:8000/).
- ```console
- $ node_modules/.bin/http-server
- ```
-
- 5. Point your browser to the [benchmark suite](http://localhost:8080/benchmark/index.html).
-
- 6. Click the **Run** button and wait for results.
+ 5. Click the **Run** button and wait for results.
diff --git a/benchmark/benchmarks.js b/benchmark/benchmarks.js
index 2eaff43..6987675 100644
--- a/benchmark/benchmarks.js
+++ b/benchmark/benchmarks.js
@@ -1,52 +1,42 @@
-/* global module */
-
"use strict";
-(function(root, factory) {
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = factory();
- } else {
- root.benchmarks = factory();
+var benchmarks = [
+ {
+ id: "json",
+ title: "JSON",
+ tests: [
+ { file: "example1.json", title: "Example 1" },
+ { file: "example2.json", title: "Example 2" },
+ { file: "example3.json", title: "Example 3" },
+ { file: "example4.json", title: "Example 4" },
+ { file: "example5.json", title: "Example 5" }
+ ]
+ },
+ {
+ id: "css",
+ title: "CSS",
+ tests: [
+ { file: "blueprint/src/reset.css", title: "Blueprint - reset.css (source)" },
+ { file: "blueprint/src/typography.css", title: "Blueprint - typography.css (source)" },
+ { file: "blueprint/src/forms.css", title: "Blueprint - forms.css (source)" },
+ { file: "blueprint/src/grid.css", title: "Blueprint - grid.css (source)" },
+ { file: "blueprint/src/print.css", title: "Blueprint - print.css (source)" },
+ // Contains syntax errors.
+ // { file: "blueprint/src/ie.css", title: "Blueprint - ie.css (source)" },
+ { file: "blueprint/min/screen.css", title: "Blueprint - screen.css (minified)" },
+ { file: "blueprint/min/print.css", title: "Blueprint - print.css (minified)" },
+ // Contains syntax errors.
+ // { file: "blueprint/min/ie.css", title: "Blueprint - ie.css (minified)" },
+ { file: "960.gs/src/reset.css", title: "960.gs - reset.css (source)" },
+ { file: "960.gs/src/text.css", title: "960.gs - text.css (source)" },
+ { file: "960.gs/src/960.css", title: "960.gs - 960.css (source)" },
+ { file: "960.gs/src/960_24_col.css", title: "960.gs - 960_24_col.css (source)" },
+ { file: "960.gs/min/reset.css", title: "960.gs - reset.css (minified)" },
+ { file: "960.gs/min/text.css", title: "960.gs - text.css (minified)" },
+ { file: "960.gs/min/960.css", title: "960.gs - 960.css (minified)" },
+ { file: "960.gs/min/960_24_col.css", title: "960.gs - 960_24_col.css (minified)" }
+ ]
}
-}(this, function() {
-
- return [
- {
- id: "json",
- title: "JSON",
- tests: [
- { file: "example1.json", title: "Example 1" },
- { file: "example2.json", title: "Example 2" },
- { file: "example3.json", title: "Example 3" },
- { file: "example4.json", title: "Example 4" },
- { file: "example5.json", title: "Example 5" }
- ]
- },
- {
- id: "css",
- title: "CSS",
- tests: [
- { file: "blueprint/src/reset.css", title: "Blueprint - reset.css (source)" },
- { file: "blueprint/src/typography.css", title: "Blueprint - typography.css (source)" },
- { file: "blueprint/src/forms.css", title: "Blueprint - forms.css (source)" },
- { file: "blueprint/src/grid.css", title: "Blueprint - grid.css (source)" },
- { file: "blueprint/src/print.css", title: "Blueprint - print.css (source)" },
- // Contains syntax errors.
- // { file: "blueprint/src/ie.css", title: "Blueprint - ie.css (source)" },
- { file: "blueprint/min/screen.css", title: "Blueprint - screen.css (minified)" },
- { file: "blueprint/min/print.css", title: "Blueprint - print.css (minified)" },
- // Contains syntax errors.
- // { file: "blueprint/min/ie.css", title: "Blueprint - ie.css (minified)" },
- { file: "960.gs/src/reset.css", title: "960.gs - reset.css (source)" },
- { file: "960.gs/src/text.css", title: "960.gs - text.css (source)" },
- { file: "960.gs/src/960.css", title: "960.gs - 960.css (source)" },
- { file: "960.gs/src/960_24_col.css", title: "960.gs - 960_24_col.css (source)" },
- { file: "960.gs/min/reset.css", title: "960.gs - reset.css (minified)" },
- { file: "960.gs/min/text.css", title: "960.gs - text.css (minified)" },
- { file: "960.gs/min/960.css", title: "960.gs - 960.css (minified)" },
- { file: "960.gs/min/960_24_col.css", title: "960.gs - 960_24_col.css (minified)" }
- ]
- }
- ];
+];
-}));
+module.exports = benchmarks;
diff --git a/benchmark/index.html b/benchmark/index.html
index 60c40cb..ec6a390 100644
--- a/benchmark/index.html
+++ b/benchmark/index.html
@@ -33,11 +33,8 @@
-
-
-
-
+