Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 20b7a73b49c0
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 77adf2f6b557
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jun 14, 2015

  1. Add support for Raise.

    whitequark committed Jun 14, 2015
    Copy the full SHA
    cd22b81 View commit details
  2. Add support for With.

    whitequark committed Jun 14, 2015
    Copy the full SHA
    77adf2f View commit details
Showing with 18 additions and 2 deletions.
  1. +18 −2 artiq/py2llvm/typing.py
20 changes: 18 additions & 2 deletions artiq/py2llvm/typing.py
Original file line number Diff line number Diff line change
@@ -273,6 +273,15 @@ def visit_IfExp(self, node):
if_loc=node.if_loc, else_loc=node.else_loc, loc=node.loc)
return self.visit(node)

def visit_Raise(self, node):
node = self.generic_visit(node)
if node.cause:
diag = diagnostic.Diagnostic("error",
"'raise from' syntax is not supported", {},
node.from_loc)
self.engine.process(diag)
return node

# Unsupported visitors
#
def visit_unsupported(self, node):
@@ -302,9 +311,7 @@ def visit_unsupported(self, node):
visit_Delete = visit_unsupported
visit_Import = visit_unsupported
visit_ImportFrom = visit_unsupported
visit_Raise = visit_unsupported
visit_Try = visit_unsupported
visit_With = visit_unsupported


class Inferencer(algorithm.Visitor):
@@ -717,6 +724,15 @@ def visit_Continue(self, node):
node.keyword_loc)
self.engine.process(diag)

def visit_withitem(self, node):
self.generic_visit(node)
if True: # none are supported yet
diag = diagnostic.Diagnostic("error",
"value of type {type} cannot act as a context manager",
{"type": types.TypePrinter().name(node.context_expr.type)},
node.context_expr.loc)
self.engine.process(diag)

def visit_FunctionDefT(self, node):
old_function, self.function = self.function, node
old_in_loop, self.in_loop = self.in_loop, False