Skip to content

Commit

Permalink
clean up @marchaefner's #197
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed May 7, 2013
1 parent 37a7cef commit 1a9361b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/compiler.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions lib/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/compiler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ class exports.Compiler
cases
]
[CS.Try, ({body, catchAssignee, catchBody, finallyBody}) ->
finallyBlock = if @hasFinally then forceBlock finallyBody else null
if @hasCatch or not @hasFinally
finallyBlock = if @finallyBody? then forceBlock finallyBody else null
if @catchBody? or not @finallyBody?
e = genSym 'e'
catchBlock = forceBlock catchBody
if catchAssignee?
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ loop
try
= TRY body:tryBody c:catchClause? f:finallyClause? {
return rp(new CS.Try(!!c, !!f, body.block, c ? c.assignee : null, c ? c.block : null, f ? f.block : null));
return rp(new CS.Try(body.block, c ? c.assignee : null, c ? c.block : null, f ? f.block : null));
}
tryBody = b:functionBody { return {block: b}; }
catchClause
Expand Down
5 changes: 2 additions & 3 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ createNodes
ForOf: [['isOwn', 'keyAssignee', 'valAssignee', 'target', 'filter', 'body']] # :: bool -> Assignable -> Maybe Assignable -> Exprs -> Maybe Exprs -> Maybe Exprs -> ForOf
Switch: [['expression', 'cases', 'alternate']] # :: Maybe Exprs -> [SwitchCase] -> Maybe Exprs -> Switch
SwitchCase: [['conditions', 'consequent']] # :: [Exprs] -> Maybe Expr -> SwitchCase
Try: [['hasCatch', 'hasFinally', 'body', 'catchAssignee', 'catchBody', 'finallyBody']] # :: bool -> bool -> Exprs -> Maybe Assignable -> Maybe Exprs -> Maybe Exprs -> Try
Try: [['body', 'catchAssignee', 'catchBody', 'finallyBody']] # :: Exprs -> Maybe Assignable -> Maybe Exprs -> Maybe Exprs -> Try
While: [['condition', 'body']] # :: Exprs -> Maybe Exprs -> While

ArrayInitialiser: [['members']] # :: [ArrayInitialiserMembers] -> ArrayInitialiser
Expand Down Expand Up @@ -203,7 +203,7 @@ createNodes
ArrayInitialiser, ObjectInitialiser, NegatedConditional, Conditional,
Identifier, ForOf, Functions, While, Class, Block, NewOp, Bool,
FunctionApplications, RegExps, RegExp, HeregExp, Super, Slice, Switch,
Identifiers, SwitchCase, GenSym, Try
Identifiers, SwitchCase, GenSym
} = exports


Expand Down Expand Up @@ -273,7 +273,6 @@ handlePrimitives Range, 'isInclusive'
handlePrimitives RegExp, 'data', 'flags'
handlePrimitives Slice, 'isInclusive'
handlePrimitives StaticMemberAccessOps, 'memberName'
handlePrimitives Try, 'hasCatch', 'hasFinally'


## Nodes that contain list properties
Expand Down

0 comments on commit 1a9361b

Please sign in to comment.