Fix ESLint errors in lib/parser.js

Fix the following errors:

    31:9   error  "parser" is defined but never used    no-unused-vars
   406:14  error  "expected" is defined but never used  no-unused-vars
  1304:15  error  "s1" is defined but never used        no-unused-vars
  1386:15  error  "s1" is defined but never used        no-unused-vars
  1442:15  error  "s1" is defined but never used        no-unused-vars
redux
David Majda 8 years ago
parent c8d23e5471
commit ddd4ac3787

@ -17,8 +17,9 @@ NODE_MODULES_BIN_DIR = $(NODE_MODULES_DIR)/.bin
MAIN_FILE = $(LIB_DIR)/peg.js
PARSER_SRC_FILE = $(SRC_DIR)/parser.pegjs
PARSER_OUT_FILE = $(LIB_DIR)/parser.js
PARSER_SRC_FILE = $(SRC_DIR)/parser.pegjs
PARSER_OUT_FILE = $(LIB_DIR)/parser.js
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
@ -41,7 +42,20 @@ all: browser
# Generate the grammar parser
parser:
$(PEGJS) $(PARSER_SRC_FILE) $(PARSER_OUT_FILE)
# We need to prepend ESLint header to the generated parser file because we
# don't want the various unused variables there to get reported. This is a bit
# tricky because the file is used when generating its own new version, which
# means we can't start writing the header there until we call $(PEGJS).
$(PEGJS) $(PARSER_SRC_FILE) $(PARSER_OUT_FILE_NEW)
rm -f $(PARSER_OUT_FILE)
echo '/* eslint no-unused-vars: 0 */' >> $(PARSER_OUT_FILE)
echo >> $(PARSER_OUT_FILE)
cat $(PARSER_OUT_FILE_NEW) >> $(PARSER_OUT_FILE)
rm $(PARSER_OUT_FILE_NEW)
# Build the browser version of the library
browser:

@ -1,3 +1,5 @@
/* eslint no-unused-vars: 0 */
module.exports = (function() {
"use strict";

Loading…
Cancel
Save