コード例 #1
0
ファイル: parser.py プロジェクト: thewizardplusplus/micro
    def _get_type(self, entity, functions):
        entity_type = function_type.make_type([])
        if entity.name == "IDENTIFIER":
            if entity.value in functions:
                entity_type = functions[entity.value]
            else:
                self._errors.append(
                    error.Error("unknown function {}".format(string_utilities.quote(entity.value)), entity.offset)
                )
                entity_type = None
        elif entity.name == "call":
            entity_type = function_type.make_type(entity.children[0].children[1].children[0])

        return entity_type
コード例 #2
0
ファイル: lexer.py プロジェクト: thewizardplusplus/micro
 def t_error(self, token):
     self._errors.append(error.Error('the illegal character {}'.format(string_utilities.quote(token.value[0])), token.lexpos))
     self._lexer.skip(1)