Commit 3286340c authored by Sebastian Biewer's avatar Sebastian Biewer
Browse files

Fixed exception forwarding in type checker

parent c77d83fd
# Change Log for PseuCo Language
## 0.8.5 - 2020-06-04
### Fixed
- Unexpected exceptions (i.e., exceptions that are not used to propagate pseuCo type errors but indicate implementation mistakes of the type checking itself) are now propagated up to the caller of the type checking process. Previously, such exceptions might have been discarded, which led to ill-typed programs being accepted as well typed.
## 0.8.4 - 2020-06-03
### Fixed
......
......@@ -170,6 +170,8 @@ class PCProgram extends PCNode
catch e
if e and e.wholeFile?
PCErrorList.push e
else
throw e
collectEnvironment: (env) ->
@globalDeclarations(env)
......@@ -179,6 +181,8 @@ class PCProgram extends PCNode
catch e
if e and e.wholeFile?
PCErrorList.push e
else
throw e
# Collects complete environment for type checking
_collectEnvironment: (env) ->
......@@ -213,6 +217,8 @@ class PCProgram extends PCNode
catch e
if e and e.wholeFile?
PCErrorList.push e
else
throw e
try
env.getMainAgent()
catch
......@@ -1701,6 +1707,8 @@ class PCStmtBlock extends PCNode
catch e
if e and e.wholeFile?
PCErrorList.push e
else
throw e
if child instanceof PCStatement and child.children[0]? and child.children[0] instanceof PCStmtBlock
env.setReturnExhaustive() if child.children[0].isReturnExhaustive
env.closeEnvironment()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment