From 79a50b3abebee9613b227e96717d2842f133cd3c Mon Sep 17 00:00:00 2001 From: Emily Eisenberg Date: Wed, 24 Jul 2013 20:37:56 -0700 Subject: [PATCH] Make the linter happy Auditors: alpert --- Lexer.js | 24 ++++++++++++------------ Makefile | 2 +- Parser.js | 2 +- Style.js | 16 ++++++++-------- katex.js | 2 +- utils.js | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Lexer.js b/Lexer.js index 7839e0eed..b1b07e09c 100644 --- a/Lexer.js +++ b/Lexer.js @@ -14,18 +14,18 @@ function LexResult(type, text, position) { // "normal" types of tokens var normals = [ - [/^[/|@."`0-9]/, 'textord'], - [/^[a-zA-Z]/, 'mathord'], - [/^[*+-]/, 'bin'], - [/^[=<>]/, 'rel'], - [/^[,;]/, 'punct'], + [/^[/|@."`0-9]/, "textord"], + [/^[a-zA-Z]/, "mathord"], + [/^[*+-]/, "bin"], + [/^[=<>]/, "rel"], + [/^[,;]/, "punct"], [/^'/, "'"], - [/^\^/, '^'], - [/^_/, '_'], - [/^{/, '{'], - [/^}/, '}'], - [/^[(\[]/, 'open'], - [/^[)\]?!]/, 'close'] + [/^\^/, "^"], + [/^_/, "_"], + [/^{/, "{"], + [/^}/, "}"], + [/^[(\[]/, "open"], + [/^[)\]?!]/, "close"] ]; // Build a regex to easily parse the functions @@ -42,7 +42,7 @@ Lexer.prototype.lex = function(pos) { // If there's no more input to parse, return an EOF token if (input.length === 0) { - return new LexResult('EOF', null, pos); + return new LexResult("EOF", null, pos); } var match; diff --git a/Makefile b/Makefile index 455b03e8f..ced55fb5e 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ compress: build/katex.min.js @printf "Minified, gzipped size: " @gzip -c $^ | wc -c -build/katex.js: katex.js Parser.js Lexer.js +build/katex.js: katex.js $(wildcard *.js) ./node_modules/.bin/browserify $< --standalone katex > $@ build/katex.min.js: build/katex.js diff --git a/Parser.js b/Parser.js index 0cfe3449e..98e171031 100644 --- a/Parser.js +++ b/Parser.js @@ -46,7 +46,7 @@ Parser.prototype.parseInput = function(pos) { var expression = this.parseExpression(pos); // If we succeeded, make sure there's an EOF at the end var EOF = this.lexer.lex(expression.position); - expect(EOF, 'EOF'); + expect(EOF, "EOF"); return expression; }; diff --git a/Style.js b/Style.js index 5d85427de..919daf4f4 100644 --- a/Style.js +++ b/Style.js @@ -27,13 +27,13 @@ Style.prototype.cls = function() { return sizeNames[this.size] + (this.cramped ? " cramped" : " uncramped"); }; -var D = 0; -var Dc = 1; -var T = 2; -var Tc = 3; -var S = 4; -var Sc = 5; -var SS = 6; +var D = 0; +var Dc = 1; +var T = 2; +var Tc = 3; +var S = 4; +var Sc = 5; +var SS = 6; var SSc = 7; var sizeNames = [ @@ -61,5 +61,5 @@ var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; module.exports = { DISPLAY: styles[D], - TEXT: styles[T], + TEXT: styles[T] }; diff --git a/katex.js b/katex.js index fa2699f13..bfbda8104 100644 --- a/katex.js +++ b/katex.js @@ -10,7 +10,7 @@ var buildExpression = function(style, color, expression, prev) { var group = expression[i]; groups.push(buildGroup(style, color, group, prev)); prev = group; - }; + } return groups; }; diff --git a/utils.js b/utils.js index 2f6cf984d..f31a9e272 100644 --- a/utils.js +++ b/utils.js @@ -15,4 +15,4 @@ var contains = Array.prototype.indexOf ? fastContains : slowContains; module.exports = { contains: contains -} +};