X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Ftokenizer.lex;h=9ac960747dc3ed7343309b3089d38635e0210875;hb=6b14c68239f98b818a7aacacc49bb7a16bfa7812;hp=8a94edbd5f94c9e89c7b563a2277f252e4a74e1c;hpb=98274d31d2a91c0f8a577e6779219e11aaf293bb;p=swftools.git diff --git a/lib/as3/tokenizer.lex b/lib/as3/tokenizer.lex index 8a94edb..9ac9607 100644 --- a/lib/as3/tokenizer.lex +++ b/lib/as3/tokenizer.lex @@ -156,7 +156,7 @@ void handleInclude(char*text, int len, char quotes) filename = strdup(&text[i1]); } - char*fullfilename = find_file(filename); + char*fullfilename = find_file(filename, 1); enter_file2(filename, fullfilename, YY_CURRENT_BUFFER); yyin = fopen(fullfilename, "rb"); if (!yyin) { @@ -259,8 +259,15 @@ static int do_unescape(const char*s, const char*end, char*n) } break; } - default: - syntaxerror("unknown escape sequence: \"\\%c\"", *s); + default: { + if(o) { + o[len+0] = '\\'; + o[len+1] = *s; + } + s++; + len+=2; + break; + } } } if(o) o[len]=0; @@ -521,6 +528,10 @@ void tokenizer_register_namespace(const char*id) { trie_put(&namespaces, id); } +void tokenizer_unregister_namespace(const char*id) +{ + trie_remove(namespaces, id); +} static inline tokenizer_is_namespace(const char*id) { return trie_lookup(namespaces, id); @@ -638,7 +649,7 @@ switch {c();BEGIN(INITIAL);a3_lval.id="";return T_SWITCH;} \.\. {c();BEGIN(REGEXPOK);return m(T_DOTDOT);} \. {c();BEGIN(REGEXPOK);return m('.');} :: {c();BEGIN(REGEXPOK);return m(T_COLONCOLON);} -: {c();BEGIN(INITIAL);return m(':');} +: {c();BEGIN(REGEXPOK);return m(':');} instanceof {c();BEGIN(REGEXPOK);return m(KW_INSTANCEOF);} implements {c();BEGIN(REGEXPOK);return m(KW_IMPLEMENTS);} interface {c();BEGIN(INITIAL);return m(KW_INTERFACE);}