Browse Source

Merge pull request #4413 from timvandermeij/ps-parser-syntax

Making src/core/ps_parser.js adhere to the style guide
Jonas Jenwald 11 years ago
parent
commit
fe99743844
  1. 10
      src/core/ps_parser.js

10
src/core/ps_parser.js

@ -38,8 +38,9 @@ var PostScriptParser = (function PostScriptParserClosure() { @@ -38,8 +38,9 @@ var PostScriptParser = (function PostScriptParserClosure() {
return false;
},
expect: function PostScriptParser_expect(type) {
if (this.accept(type))
if (this.accept(type)) {
return true;
}
error('Unexpected symbol: found ' + this.token.type + ' expected ' +
type + '.');
},
@ -116,9 +117,9 @@ var PostScriptToken = (function PostScriptTokenClosure() { @@ -116,9 +117,9 @@ var PostScriptToken = (function PostScriptTokenClosure() {
PostScriptToken.getOperator = function PostScriptToken_getOperator(op) {
var opValue = opCache[op];
if (opValue)
if (opValue) {
return opValue;
}
return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op);
};
@ -203,8 +204,9 @@ var PostScriptLexer = (function PostScriptLexerClosure() { @@ -203,8 +204,9 @@ var PostScriptLexer = (function PostScriptLexerClosure() {
}
}
var value = parseFloat(str);
if (isNaN(value))
if (isNaN(value)) {
error('Invalid floating point number: ' + value);
}
return value;
}
};

Loading…
Cancel
Save