diff options
author | Ian Johnson <ian.johnson@appliedlanguage.com> | 2013-11-12 17:06:05 +0400 |
---|---|---|
committer | Ian Johnson <ian.johnson@appliedlanguage.com> | 2013-11-12 17:06:05 +0400 |
commit | 3f832af94754c0e74ae9a8df8afd735f8e4c8269 (patch) | |
tree | 8cfe4e097e18395ca4377bcd7da28a01e208d323 | |
parent | 038f4f8fb7e76e339605fb5f6a40cf30eb7548c8 (diff) |
Various bugs fixed.
-rw-r--r-- | src/pclc/parser/expressions.py | 2 | ||||
-rw-r--r-- | src/pclc/parser/pcl_lexer.py | 1 | ||||
-rw-r--r-- | src/pclc/visitors/first_pass_resolver_visitor.py | 1 | ||||
-rw-r--r-- | src/pclc/visitors/third_pass_resolver_visitor.py | 2 | ||||
-rw-r--r-- | src/runtime/pcl/system/process.py | 11 |
5 files changed, 8 insertions, 9 deletions
diff --git a/src/pclc/parser/expressions.py b/src/pclc/parser/expressions.py index e2b0d73..778ed10 100644 --- a/src/pclc/parser/expressions.py +++ b/src/pclc/parser/expressions.py @@ -29,7 +29,7 @@ class Literal(Entity): self.value = value def __str__(self): - return '"' + str(self.value) + '"' if type(self.value) in types.StringTypes else str(self.value) + return str(self.value) def __repr__(self): return "<Literal: value = [%s], entity = %s>" % \ diff --git a/src/pclc/parser/pcl_lexer.py b/src/pclc/parser/pcl_lexer.py index 160af46..49e5b34 100644 --- a/src/pclc/parser/pcl_lexer.py +++ b/src/pclc/parser/pcl_lexer.py @@ -124,7 +124,6 @@ class PCLLexer(object): def t_STRING(self, t): r'"(\\.|[^"])*"' - t.value = t.value[1:-1].replace("\\", "") return t def t_newline(self, t): diff --git a/src/pclc/visitors/first_pass_resolver_visitor.py b/src/pclc/visitors/first_pass_resolver_visitor.py index 7a36888..eb4c1e4 100644 --- a/src/pclc/visitors/first_pass_resolver_visitor.py +++ b/src/pclc/visitors/first_pass_resolver_visitor.py @@ -735,6 +735,7 @@ class FirstPassResolverVisitor(ResolverVisitor): @multimethod(TerminalConditionalExpression) def visit(self, term_cond_expr): + term_cond_expr.scope = self._current_scope terminal = term_cond_expr.terminal if isinstance(terminal, StateIdentifier) and \ terminal in self._module.resolution_symbols['unused_configuration']: diff --git a/src/pclc/visitors/third_pass_resolver_visitor.py b/src/pclc/visitors/third_pass_resolver_visitor.py index f04442a..914c00e 100644 --- a/src/pclc/visitors/third_pass_resolver_visitor.py +++ b/src/pclc/visitors/third_pass_resolver_visitor.py @@ -163,7 +163,7 @@ class ThirdPassResolverVisitor(SecondPassResolverVisitor): if self._module.definition.is_leaf: self._add_errors("ERROR: %(filename)s at line %(lineno)d, unknown identifier %(identifier)s", [terminal] if terminal not in self._module.definition.inputs and \ - terminal not in self._module.resolution_symbols['assignment_table'] \ + terminal not in term_cond_expr.scope \ else [], lambda t: {'filename' : t.filename, 'lineno' : t.lineno, diff --git a/src/runtime/pcl/system/process.py b/src/runtime/pcl/system/process.py index 8165f1d..1edd2a8 100644 --- a/src/runtime/pcl/system/process.py +++ b/src/runtime/pcl/system/process.py @@ -45,11 +45,10 @@ def callAndCheck(program, def checkOutput(program, stdin_stream = sys.stdin, - stdout_stream = sys.stdout, stderr_stream = sys.stderr): cmd_line, is_shell = __pre_process_program(program) - return subprocess.check_output(cmd_line, - stdin = stdin_stream, - stdout = stdout_stream, - stderr = stderr_stream, - shell = is_shell) + output = subprocess.check_output(cmd_line, + stdin = stdin_stream, + stderr = stderr_stream, + shell = is_shell) + return output.strip() |