Show
Ignore:
Timestamp:
01/01/08 00:00:27 (7 years ago)
Author:
gyuque
Message:

lang/ruby/ActionScriptPreprocessor: implemented #undef

Location:
lang/ruby/ActionScriptPreprocessor/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ActionScriptPreprocessor/trunk/aspp.rb

    r3849 r3909  
    279279end 
    280280 
     281def parse_undef_instrunction(toks, macro_table) 
     282        t = skip_wstoks(toks) 
     283        raise "missing token after #define" if t == nil 
     284        raise "bad token '#{t[:tok]}' after #undef" if t[:type] != TK_IDENT 
     285 
     286        ident = t[:tok] 
     287        macro_table.delete(ident) if macro_table.has_key?(ident) 
     288end 
     289 
    281290def parse_include_instrunction(toks, macro_table) 
    282291        t = skip_wstoks(toks) 
     
    315324        when "include" 
    316325                parse_include_instrunction(toks, macro_table) 
     326        when "undef" 
     327                parse_undef_instrunction(toks, macro_table) 
    317328        else 
    318329                raise "unkown instruction '#{inst_name}'" 
  • lang/ruby/ActionScriptPreprocessor/trunk/pptest.a$

    r3831 r3909  
    1717                _root.createTextField("tx", 1, 0, 0, 64, 64); 
    1818                _root.tx.text = LABEL + i; // must be "sum:" + i 
     19 
     20#undef LABEL 
     21                var LABEL:Number = 0; // must NOT be replaced after #undef! 
    1922        } 
    2023}