Skip to content

fix: TernaryExpression + AstEvaluatorGeneratedValuePath テスト失敗 — transaction nest is illegal #6

Description

@opaopa6969

症状

unlaxer 3.0.1 で (true ? 1 : 2) などの ternary 式をパースすると:

org.unlaxer.parser.ParseException: failed to parse (P4):(true ? 1 : 2)
cause=transaction nest is illegal. check source code.

原因

TinyExpressionP4Mapper.parse(String)ParseContext を作成するが、
ScopeStore.registerDispatcher(context) を呼ばないため、
FormulaParser@scopeTree(mode=lexical) による TransactionListener 実装)の
onBegin/onCommit/onRollback が呼ばれない。

その結果、パース失敗時に ParseContext.close()tokenStack.size() != 1 を検出して
IllegalStateException("transaction nest is illegal") を投げる。

影響テスト

  • TernaryExpressionTest (32件 ERROR)
  • AstEvaluatorGeneratedValuePathTest (11件 FAIL)

修正方針

TinyExpressionP4Mapper.parseScopeStore.registerDispatcher(context) を追加する。
または MapperGenerator.emitEntryPoint がこれを自動生成するよう修正する。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions