X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Ftokenizer.lex;h=31e5841db8ea3cd0404c61c308031f5ddd80d8b4;hb=015233e6dbf54b574dd7f55d11c0d0d614802fde;hp=bc4f01248265ed1d3763defc33378849f7b6c4a4;hpb=0fd17f47ee30d90181e51f30fc17a6c31646137e;p=swftools.git diff --git a/lib/as3/tokenizer.lex b/lib/as3/tokenizer.lex index bc4f012..31e5841 100644 --- a/lib/as3/tokenizer.lex +++ b/lib/as3/tokenizer.lex @@ -45,7 +45,7 @@ void as3_error(const char*format, ...) va_start(arglist, format); vsprintf(buf, format, arglist); va_end(arglist); - fprintf(stderr, "%s:%d:%d: error: %s\n", current_filename_short, current_line, current_column, buf); + fprintf(stderr, "%s:%d:%d: error: %s\n", current_filename, current_line, current_column, buf); fflush(stderr); exit(1); } @@ -59,7 +59,7 @@ void as3_warning(const char*format, ...) va_start(arglist, format); vsprintf(buf, format, arglist); va_end(arglist); - fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename_short, current_line, current_column, buf); + fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename, current_line, current_column, buf); fflush(stderr); } void as3_softwarning(const char*format, ...) @@ -72,7 +72,7 @@ void as3_softwarning(const char*format, ...) va_start(arglist, format); vsprintf(buf, format, arglist); va_end(arglist); - fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename_short, current_line, current_column, buf); + fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename, current_line, current_column, buf); fflush(stderr); } static void dbg(const char*format, ...) @@ -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; @@ -288,12 +295,6 @@ static void handleCData(char*s, int len) static void handleString(char*s, int len) { - if(as3_pass < 2) { - // don't bother decoding strings in pass 1 - memset(&a3_lval, 0, sizeof(a3_lval)); - return; - } - if(s[0]=='"') { if(s[len-1]!='"') syntaxerror("String doesn't end with '\"'"); s++;len-=2; @@ -303,7 +304,6 @@ static void handleString(char*s, int len) s++;len-=2; } else syntaxerror("String incorrectly terminated"); - a3_lval.str = string_unescape(s, len); } @@ -516,14 +516,18 @@ static inline void c() { current_column+=yyleng; } -static trie_t*namespaces = 0; -void tokenizer_register_namespace(const char*id) +trie_t*active_namespaces = 0; +/*void tokenizer_register_namespace(const char*id) { - trie_put(&namespaces, id); + trie_put(namespaces, id, 0); } +void tokenizer_unregister_namespace(const char*id) +{ + trie_remove(namespaces, id); +}*/ static inline tokenizer_is_namespace(const char*id) { - return trie_lookup(namespaces, id); + return trie_contains(active_namespaces, id); } static inline int handleIdentifier()