| Index: tools/lexer_generator/code_generator.py
|
| diff --git a/tools/lexer_generator/code_generator.py b/tools/lexer_generator/code_generator.py
|
| index a703890e076c193046d23f98ab84333bc8f23835..e6d44662908f0e8bc32decc2d3a006cddebaae0f 100644
|
| --- a/tools/lexer_generator/code_generator.py
|
| +++ b/tools/lexer_generator/code_generator.py
|
| @@ -247,12 +247,9 @@ class CodeGenerator:
|
| template = template_env.get_template('code_generator.jinja')
|
|
|
| encoding = self.__dfa.encoding().name()
|
| - if encoding == 'latin1':
|
| - char_type = 'uint8_t'
|
| - elif encoding == 'utf16':
|
| - char_type = 'uint16_t'
|
| - else:
|
| - raise Exception('Unsupported encoding %s' % encoding)
|
| + char_types = {'latin1': 'uint8_t', 'utf16': 'uint16_t', 'utf8': 'int8_t'}
|
| + char_type = char_types[encoding]
|
| +
|
| return template.render(
|
| start_node_number = 0,
|
| debug_print = self.__debug_print,
|
|
|