Make the linter happy

Auditors: alpert
This commit is contained in:
Emily Eisenberg 2013-07-24 20:37:56 -07:00
parent fa101db4e1
commit 79a50b3abe
6 changed files with 24 additions and 24 deletions

View File

@ -14,18 +14,18 @@ function LexResult(type, text, position) {
// "normal" types of tokens // "normal" types of tokens
var normals = [ var normals = [
[/^[/|@."`0-9]/, 'textord'], [/^[/|@."`0-9]/, "textord"],
[/^[a-zA-Z]/, 'mathord'], [/^[a-zA-Z]/, "mathord"],
[/^[*+-]/, 'bin'], [/^[*+-]/, "bin"],
[/^[=<>]/, 'rel'], [/^[=<>]/, "rel"],
[/^[,;]/, 'punct'], [/^[,;]/, "punct"],
[/^'/, "'"], [/^'/, "'"],
[/^\^/, '^'], [/^\^/, "^"],
[/^_/, '_'], [/^_/, "_"],
[/^{/, '{'], [/^{/, "{"],
[/^}/, '}'], [/^}/, "}"],
[/^[(\[]/, 'open'], [/^[(\[]/, "open"],
[/^[)\]?!]/, 'close'] [/^[)\]?!]/, "close"]
]; ];
// Build a regex to easily parse the functions // 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 there's no more input to parse, return an EOF token
if (input.length === 0) { if (input.length === 0) {
return new LexResult('EOF', null, pos); return new LexResult("EOF", null, pos);
} }
var match; var match;

View File

@ -5,7 +5,7 @@ compress: build/katex.min.js
@printf "Minified, gzipped size: " @printf "Minified, gzipped size: "
@gzip -c $^ | wc -c @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 > $@ ./node_modules/.bin/browserify $< --standalone katex > $@
build/katex.min.js: build/katex.js build/katex.min.js: build/katex.js

View File

@ -46,7 +46,7 @@ Parser.prototype.parseInput = function(pos) {
var expression = this.parseExpression(pos); var expression = this.parseExpression(pos);
// If we succeeded, make sure there's an EOF at the end // If we succeeded, make sure there's an EOF at the end
var EOF = this.lexer.lex(expression.position); var EOF = this.lexer.lex(expression.position);
expect(EOF, 'EOF'); expect(EOF, "EOF");
return expression; return expression;
}; };

View File

@ -27,13 +27,13 @@ Style.prototype.cls = function() {
return sizeNames[this.size] + (this.cramped ? " cramped" : " uncramped"); return sizeNames[this.size] + (this.cramped ? " cramped" : " uncramped");
}; };
var D = 0; var D = 0;
var Dc = 1; var Dc = 1;
var T = 2; var T = 2;
var Tc = 3; var Tc = 3;
var S = 4; var S = 4;
var Sc = 5; var Sc = 5;
var SS = 6; var SS = 6;
var SSc = 7; var SSc = 7;
var sizeNames = [ var sizeNames = [
@ -61,5 +61,5 @@ var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
module.exports = { module.exports = {
DISPLAY: styles[D], DISPLAY: styles[D],
TEXT: styles[T], TEXT: styles[T]
}; };

View File

@ -10,7 +10,7 @@ var buildExpression = function(style, color, expression, prev) {
var group = expression[i]; var group = expression[i];
groups.push(buildGroup(style, color, group, prev)); groups.push(buildGroup(style, color, group, prev));
prev = group; prev = group;
}; }
return groups; return groups;
}; };

View File

@ -15,4 +15,4 @@ var contains = Array.prototype.indexOf ? fastContains : slowContains;
module.exports = { module.exports = {
contains: contains contains: contains
} };