Changeset 3952 for proto


Ignore:
Timestamp:
Aug 4, 2014, 7:22:08 AM (5 years ago)
Author:
cameron
Message:

Compiler for Unicode general categories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/CC_compiler.py

    r3950 r3952  
    204204        #self.generated_code.append('%s%s = %s;\n' % (self.typedecl, varname, expr))
    205205        self.generated_code.append('\t%s%s = %s\n' % (self.typedecl, varname, expr))
     206
     207    def add_if_stmt(self, test_expr, generated_subcode):
     208        test_line = 'if %s:\n' % (self.expr_string_to_variable(self.expr2py(test_expr)))
     209        self.generated_code.append('\t' + test_line)
     210        self.generated_code += ['\t' + line for line in generated_subcode]
     211        self.generated_code.append('\t#end' + test_line)
     212       
    206213
    207214    def expr_string_to_variable(self, expr_string):
Note: See TracChangeset for help on using the changeset viewer.