X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fparser.lex;h=e03175a1f9703931cade508c8025a0c5ccf1d900;hp=beca943b1f55c757ec37462a52029c0fedf9aa4c;hb=f7555c9f25b9008e1996e029f83ebeaaafd95321;hpb=ee15a3b589d20a918d60e91a58eea067faf75cfc diff --git a/src/parser.lex b/src/parser.lex index beca943..e03175a 100644 --- a/src/parser.lex +++ b/src/parser.lex @@ -3,7 +3,7 @@ #include #include #include -#include "q.h" +#include "../lib/q.h" #include "parser.h" //RVALUE {NUMBER}|{PERCENT}|{NAME}|\"{STRING}\"|{DIM} @@ -88,8 +88,8 @@ static void store(enum type_t type, int line, int column, char*text, int length) } prefix = 0; break; - case LABEL: - string_set2(&tmp, text, length-1); + case RAWDATA: + string_set2(&tmp, text+1/*:*/, length-5/*.end*/); token.text = (char*)mem_putstring(&strings, tmp); break; case COMMAND: @@ -163,8 +163,8 @@ void handleInclude(char*text, int len) %x BINARY NAME [a-zA-Z_./](-*[a-zA-Z0-9_./])* -TWIP ([0-9]+(\.([0-9]([05])?)?)?) -NUMBER [0-9]+(\.[0-9]*)? +TWIP (-?[0-9]+(\.([0-9]([05])?)?)?) +NUMBER -?[0-9]+(\.[0-9]*)? PERCENT {NUMBER}% STRING (\\.|[^\\"\n])* S [ \n\r\t] @@ -189,7 +189,7 @@ RVALUE \"{STRING}\"|([^ \n\r\t]+) } \.include{S}.*\n {handleInclude(yytext, yyleng);} \.{NAME} {s(COMMAND);c();} -{NAME}{S}*: {s(LABEL);c();} +:([^.]|\.[^e]|\.e[^n]|\.en[^d]|[ \n\r\t])*\.end {s(RAWDATA);c();} {NAME} {s(IDENTIFIER);c();} "[" {c();BEGIN(BINARY);} {S} {c();}