Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Serdar Yegulalp committed Apr 14, 2019
1 parent c1b59ca commit dde1517
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions aki/core/akitypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 7 additions & 5 deletions aki/core/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions aki/core/lex.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class AkiLexer(Lexer):
ASSIGN = r"\="
BIN_AND = r"\&"
BIN_OR = r"\|"
QUOTE = r'\"'
QUOTE = r"\""
APOST = r"\'"
BACKQUOTE = r"\`"

Expand All @@ -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")
Expand Down

0 comments on commit dde1517

Please sign in to comment.