diff options
author | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-06 14:16:20 +0100 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-06 14:16:20 +0100 |
commit | 24f1407f1f30993ee8dd35d2f52409bcba839a8f (patch) | |
tree | ba7557d3753e2e96e1642af38a58170aff141c07 /src/genjsbind-lexer.l | |
parent | c1db25526a6990263e9703634401178975cf9d61 (diff) | |
download | nsgenbind-24f1407f1f30993ee8dd35d2f52409bcba839a8f.tar.gz nsgenbind-24f1407f1f30993ee8dd35d2f52409bcba839a8f.tar.bz2 |
add preamble blocks delinited by [[[ and ]]]
Improve separation of binding file handling
Diffstat (limited to 'src/genjsbind-lexer.l')
-rw-r--r-- | src/genjsbind-lexer.l | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l index ae458fe..8364247 100644 --- a/src/genjsbind-lexer.l +++ b/src/genjsbind-lexer.l @@ -35,6 +35,12 @@ quotedstring [^\"\\\n\r] other [^\t\n\r 0-9A-Z_a-z] +cblockopen \[\[\[ + +cblockclose \]\]\] + +%x cblock + %% {whitespace} /* nothing */ @@ -45,6 +51,10 @@ hdrcomment return TOK_HDR_COMMENT; interface return TOK_INTERFACE; +preamble return TOK_PREAMBLE; + +{cblockopen} BEGIN(cblock); + \"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL; {multicomment} /* nothing */ @@ -53,4 +63,8 @@ interface return TOK_INTERFACE; . /* nothing */ +<cblock>[^\]]* yylval->text = strdup(yytext); return TOK_CCODE_LITERAL; +<cblock>{cblockclose} BEGIN(INITIAL); +<cblock>\]+ yylval->text = strdup(yytext); return TOK_CCODE_LITERAL; + %% |