Skip to content

Commit

Permalink
Small tweaks to Swift.stg to allow throwing operations in actions
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Pokhylets <mykola.pokhylets@gmail.com>
  • Loading branch information
nickolas-pohilets authored and parrt committed Feb 19, 2023
1 parent b6cb1cc commit d7ae9c1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func action(_ _localctx: RuleContext?, _ ruleIndex: Int, _ actionIndex: Int) th
switch (ruleIndex) {
<recog.actionFuncs.values:{f|
case <f.ruleIndex>:
<f.name>_action((_localctx as <f.ctxType>?), actionIndex)
try <f.name>_action((_localctx as <f.ctxType>?), actionIndex)
}; separator="\n">
default: break
}
Expand Down Expand Up @@ -364,7 +364,7 @@ init(_ input:TokenStream) throws {
* overriding implementation impossible to maintain.
*/
RuleActionFunction(r, actions) ::= <<
private func <r.name>_action(_ _localctx: <r.ctxType>?, _ actionIndex: Int) {
private func <r.name>_action(_ _localctx: <r.ctxType>?, _ actionIndex: Int) throws {
switch (actionIndex) {
<actions:{index|
case <index>:
Expand Down

0 comments on commit d7ae9c1

Please sign in to comment.