import type * as acorn from 'acorn'; /** * Deviations from standard JavaScript that define Companion's expression dialect, beyond the `$(...)` * variable syntax (which lives in ./CompanionVariables.ts). * * Each quirk is its own small, single-method acorn plugin so its intent and scope are self-evident. * They override disjoint parser methods, so the order they are composed in does not matter. */ /** * Top-level `{` is parsed as an object literal, not a block statement. * * This is not a deliberate language rule: jsep (the previous parser) was expression-only and could * never produce a block, so `{...}` always meant an object. We preserve that for backward * compatibility - and because a leading object literal is meaningful as the expression's (implicit) * result value, e.g. `{ 1: 'on', 2: 'off' }[$(internal:state)]`. * * Gated to `topLevel`, so nested `{}` (e.g. `if`/`for`/`while` bodies) are still parsed as real * blocks. The only thing given up is a bare standalone block at the top level, which has no useful * meaning in this dialect. */ export declare function topLevelObjectLiteralAcornPlugin(BaseParser: typeof acorn.Parser): typeof acorn.Parser; /** * Prefix `++`/`--` applied to a non-assignable operand is treated as repeated unary `+`/`-` * (e.g. `--1` means `-(-1)`), rather than a syntax error. Only Identifier/MemberExpression operands * form a real increment/decrement. */ export declare function repeatedUnaryAcornPlugin(BaseParser: typeof acorn.Parser): typeof acorn.Parser; /** * A template literal on a new line must NOT be consumed as a tagged template of the preceding * expression. * * JS ASI does not break before a backtick (a backtick continues the expression), so * `a = 1` `` `x` `` parses as the tagged template `` a = 1`x` `` - which this dialect * rejects, surprising users who expect two separate statements. When a newline precedes the backtick, * stop the subscript chain so ASI splits the statements as intended. * * A backtick on the *same* line still parses as a tagged template and is rejected by validation with * a friendly message, so genuine mistakes keep their clear error. */ export declare function templateLiteralAsiAcornPlugin(BaseParser: typeof acorn.Parser): typeof acorn.Parser; //# sourceMappingURL=CompanionDialect.d.ts.map