diff --git a/source/parser.hera b/source/parser.hera index ff0ad8a3..e919e87b 100644 --- a/source/parser.hera +++ b/source/parser.hera @@ -52,6 +52,10 @@ import { wrapIIFE, } from "./parser/lib.civet" +import type { + UpdateExpression, +} from "./parser/types.civet" + /** * A global object to hold methods used in rule handlers * We can probably transition away from this now that Hera @@ -455,7 +459,7 @@ NWTypePostfix # https://262.ecma-international.org/#prod-UpdateExpression UpdateExpression # NOTE: Not allowing whitespace betwen prefix and postfix increment operators and operand - UpdateExpressionSymbol UnaryWithoutParenthesizedAssignment -> + UpdateExpressionSymbol UnaryWithoutParenthesizedAssignment :: UpdateExpression -> return { type: "UpdateExpression", assigned: $2, diff --git a/source/parser/pipe.civet b/source/parser/pipe.civet index 53113c18..9c4c5b71 100644 --- a/source/parser/pipe.civet +++ b/source/parser/pipe.civet @@ -90,7 +90,6 @@ function constructPipeStep(fn, arg, returning) { return [constructInvocation(fn, arg), null] } - // head: expr // body: [ws, pipe, ws, expr][] diff --git a/source/parser/types.civet b/source/parser/types.civet index 61bae827..54800a90 100644 --- a/source/parser/types.civet +++ b/source/parser/types.civet @@ -62,6 +62,11 @@ export type StatementTuple = [IndentNode, ASTNode, StatementDelimiter?] export type Condition = ParenthesizedExpression +export type UpdateExpression + type: "UpdateExpression" + children: Children + assigned: ASTNode + export type ParenthesizedExpression type: "ParenthesizedExpression" children: Children