Skip to content

Commit

Permalink
fix several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wintercn committed Apr 30, 2012
1 parent 530fb4b commit 925f3c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions source/LexicalParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
LineTerminator:/[\n\r\u2028\u2029]/,
Comment:"<SingleLineComment>|<MultiLineComment>",
SingleLineComment:/\/\/[^\n\r\u2028\u2029]*/,
MultiLineComment:/\/\*(?:[^*]|\*[^\/])*\*\//,
MultiLineComment:/\/\*(?:[^*]|\*[^\/])*\*?\*\//,
Keyword:/break(?![_$a-zA-Z0-9])|else(?![_$a-zA-Z0-9])|new(?![_$a-zA-Z0-9])|var(?![_$a-zA-Z0-9])|case(?![_$a-zA-Z0-9])|finally(?![_$a-zA-Z0-9])|return(?![_$a-zA-Z0-9])|void(?![_$a-zA-Z0-9])|catch(?![_$a-zA-Z0-9])|for(?![_$a-zA-Z0-9])|switch(?![_$a-zA-Z0-9])|while(?![_$a-zA-Z0-9])|continue(?![_$a-zA-Z0-9])|function(?![_$a-zA-Z0-9])|this(?![_$a-zA-Z0-9])|with(?![_$a-zA-Z0-9])|default(?![_$a-zA-Z0-9])|if(?![_$a-zA-Z0-9])|throw(?![_$a-zA-Z0-9])|delete(?![_$a-zA-Z0-9])|in(?![_$a-zA-Z0-9])|try(?![_$a-zA-Z0-9])|do(?![_$a-zA-Z0-9])|instanceof(?![_$a-zA-Z0-9])|typeof(?![_$a-zA-Z0-9])/,
FutureReservedWord:/abstract(?![_$a-zA-Z0-9])|enum(?![_$a-zA-Z0-9])|int(?![_$a-zA-Z0-9])|short(?![_$a-zA-Z0-9])|boolean(?![_$a-zA-Z0-9])|export(?![_$a-zA-Z0-9])|interface(?![_$a-zA-Z0-9])|static(?![_$a-zA-Z0-9])|byte(?![_$a-zA-Z0-9])|extends(?![_$a-zA-Z0-9])|long(?![_$a-zA-Z0-9])|super(?![_$a-zA-Z0-9])|char(?![_$a-zA-Z0-9])|final(?![_$a-zA-Z0-9])|native(?![_$a-zA-Z0-9])|synchronized(?![_$a-zA-Z0-9])|class(?![_$a-zA-Z0-9])|float(?![_$a-zA-Z0-9])|package(?![_$a-zA-Z0-9])|throws(?![_$a-zA-Z0-9])|const(?![_$a-zA-Z0-9])|goto|(?![_$a-zA-Z0-9])private(?![_$a-zA-Z0-9])|transient(?![_$a-zA-Z0-9])|debugger(?![_$a-zA-Z0-9])|implements(?![_$a-zA-Z0-9])|(?![_$a-zA-Z0-9])protected(?![_$a-zA-Z0-9])|volatile(?![_$a-zA-Z0-9])|double(?![_$a-zA-Z0-9])|import(?![_$a-zA-Z0-9])|public(?![_$a-zA-Z0-9])/,
NullLiteral:/null/,
BooleanLiteral:/true|false/,
NullLiteral:/null(?![_$a-zA-Z0-9])/,
BooleanLiteral:/(?:true|false)(?![_$a-zA-Z0-9])/,
Identifier:/[_$a-zA-Z][_$a-zA-Z0-9]*/,
Punctuator:/>>>=|>>=|<<=|===|!==|>>>|<<|%=|\*=|-=|\+=|<=|>=|==|!=|\^=|\|=|\|\||&&|&=|>>|\+\+|--|\:|}|\*|&|\||\^|!|~|-|\+|\?|%|=|>|<|,|;|\.(?![0-9])|\]|\[|\)|\(|{/,
DivPunctuator:/\/=|\//,
Expand Down
4 changes: 2 additions & 2 deletions source/SyntaticalParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"Initialiser":[["=", "AssignmentExpression"]],
"InitialiserNoIn":[["=", "AssignmentExpressionNoIn"]],
"EmptyStatement":[[";"]],
"ExpressionStatement":[["Expression", "[lookahead∉{{,function}]", ";"]],
"ExpressionStatement":[["Expression", "[lookaheadno{{,function}]", ";"]],
"IfStatement":[["if", "(", "Expression", ")", "Statement", "else", "Statement"], ["if", "(", "Expression", ")", "Statement"]],
"IterationStatement":[["do", "Statement", "while", "(", "Expression", ")", ";"], ["while", "(", "Expression", ")", "Statement"], ["for", "(", "ExpressionNoIn", ";", "Expression", ";", "Expression", ")", "Statement"], ["for", "(", ";", "Expression", ";", "Expression", ")", "Statement"], ["for", "(", "ExpressionNoIn", ";", ";", "Expression", ")", "Statement"], ["for", "(", ";", ";", "Expression", ")", "Statement"], ["for", "(", "ExpressionNoIn", ";", "Expression", ";", ")", "Statement"], ["for", "(", ";", "Expression", ";", ")", "Statement"], ["for", "(", "ExpressionNoIn", ";", ";", ")", "Statement"], ["for", "(", ";", ";", ")", "Statement"], ["for", "(", "var", "VariableDeclarationListNoIn", ";", "Expression", ";", "Expression", ")", "Statement"], ["for", "(", "var", "VariableDeclarationListNoIn", ";", ";", "Expression", ")", "Statement"], ["for", "(", "var", "VariableDeclarationListNoIn", ";", "Expression", ";", ")", "Statement"], ["for", "(", "var", "VariableDeclarationListNoIn", ";", ";", ")", "Statement"], ["for", "(", "LeftHandSideExpression", "in", "Expression", ")", "Statement"], ["for", "(", "var", "VariableDeclarationNoIn", "in", "Expression", ")", "Statement"]],
"ContinueStatement":[["continue", ";"], ["continue", "[noLineTerminator]", "Identifier", ";"]],
Expand Down Expand Up @@ -137,7 +137,7 @@ function SyntacticalParser()
{
if(symbol.match(/\[([^\]]+)\]/))
{
if(RegExp.$1 == "lookahead∉{{,function}")
if(RegExp.$1 == "lookaheadno{{,function}")
{
rulenode["$lookahead"] = ["{", "function"];
}
Expand Down

0 comments on commit 925f3c6

Please sign in to comment.