Skip to content

Commit

Permalink
cocos 2d pass rate 92%
Browse files Browse the repository at this point in the history
Multiple lines of "#define" grammar is added.
  • Loading branch information
dongjoon1251 committed Dec 19, 2014
1 parent fa7df3c commit ef04f73
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 149 deletions.
26 changes: 24 additions & 2 deletions grammar/cpp.jisonlex
Expand Up @@ -181,8 +181,7 @@ SINGLE_PREPROCESSING [#] {Input_characters}?
{SINGLE_LINE_DOC_COMMENT} /* skip */
{NEW_LINE} /* skip */


{SINGLE_PREPROCESSING} /* skip */


/* Keywords */
"abstract" return 'ABSTRACT';
Expand Down Expand Up @@ -350,6 +349,29 @@ SINGLE_PREPROCESSING [#] {Input_characters}?
{DOT} return 'DOT'
"..." return 'DOTS'

{SINGLE_PREPROCESSING} %{
var r = yytext;
//console.log('#1: '+r);
while(r[r.length-1]=='\\'){
yylloc.first_line++;
yylloc.last_line++;
temp = '';
idx = 1;
nxtLine = this._input;
if(this._input[0]!='\n'){
idx=0;
}
while(this._input[idx]!='\n'){
temp= temp+this._input[idx];
idx++;
}
this._input = nxtLine.substring(idx);
r = temp;
}
%}

{Template} %{
//console.log(this.showPosition());
var r = yytext;
Expand Down

0 comments on commit ef04f73

Please sign in to comment.