From dde15179d938224b95688b70594973b30aaa0d84 Mon Sep 17 00:00:00 2001 From: Serdar Yegulalp Date: Sun, 14 Apr 2019 00:18:50 -0400 Subject: [PATCH] formatting --- aki/core/akitypes.py | 1 + aki/core/codegen.py | 12 +++++++----- aki/core/lex.py | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/aki/core/akitypes.py b/aki/core/akitypes.py index aec4d17..99fa50e 100644 --- a/aki/core/akitypes.py +++ b/aki/core/akitypes.py @@ -117,6 +117,7 @@ def new(self, base_type: AkiType): def format_result(self, result): return f"<{self.type_id} @ {hex(result)}>" + class AkiObject(AkiType): """ Type for objects in Aki. This is essentially a header, diff --git a/aki/core/codegen.py b/aki/core/codegen.py index fb0ae2d..3470865 100644 --- a/aki/core/codegen.py +++ b/aki/core/codegen.py @@ -923,8 +923,9 @@ def _codegen_RefExpr(self, node): if not isinstance(node.ref, Name): n1 = self._codegen(node.ref) raise AkiTypeErr( - node.ref, self.text, - f'Can\'t derive a reference as "{CMD}{n1.akinode.name}{REP}" is not a variable' + node.ref, + self.text, + f'Can\'t derive a reference as "{CMD}{n1.akinode.name}{REP}" is not a variable', ) ref = self._name(node, node.ref.name) @@ -957,8 +958,9 @@ def _codegen_DerefExpr(self, node): if not isinstance(node.ref, Name): n1 = self._codegen(node.ref) raise AkiTypeErr( - node.ref, self.text, - f'Can\'t extract a reference as "{CMD}{n1.akinode.name}{REP}" is not a variable' + node.ref, + self.text, + f'Can\'t extract a reference as "{CMD}{n1.akinode.name}{REP}" is not a variable', ) ref = self._name(node, node.ref.name) @@ -967,7 +969,7 @@ def _codegen_DerefExpr(self, node): raise AkiTypeErr( node.ref, self.text, - f'Can\'t extract a reference as "{CMD}{node.ref.name}{REP}" is not a pointer' + f'Can\'t extract a reference as "{CMD}{node.ref.name}{REP}" is not a pointer', ) f0 = self.builder.load(ref) diff --git a/aki/core/lex.py b/aki/core/lex.py index f026de2..f488694 100644 --- a/aki/core/lex.py +++ b/aki/core/lex.py @@ -120,7 +120,7 @@ class AkiLexer(Lexer): ASSIGN = r"\=" BIN_AND = r"\&" BIN_OR = r"\|" - QUOTE = r'\"' + QUOTE = r"\"" APOST = r"\'" BACKQUOTE = r"\`" @@ -142,7 +142,7 @@ def INTEGER(self, t): @_(r"\#[^\n]*\n") def comment(self, t): pass - + @_(r"\n+") def newline(self, t): self.lineno += t.value.count("\n")