Skip to content

Unify syntax-error coordinates across TS, C# and C++ #28

Open

Description

@Zanzavar

Follow-up from #24.

The three runtimes report syntax-error coordinates differently, while enum/variable validation errors now share one system: a logical block line plus a UTF-16 offset into the raw HTML after the opening code tag.

Observed at 8a0c46c:

Input TS C# C++
<pre><code>show(1)</code></pre><pre><code>show(1, )</code></pre> 2:8 Line/Column null, message 1:50 1:50
<pre><code>show(1, x = 2)</code></pre> line 0 line 1 line 1
  • C#: ParseException.Line/Column stay null for syntax errors (CSharp/Interpreter/ArcscriptTranspiler.cs), and the message uses ANTLR's physical line:col.
  • C++: ANTLR's physical line and code-point column go into the same fields that enum errors use for the block line and UTF-16 offset.
  • TS (TypeScript/src/ErrorListener.ts): currentLine/openTagEndPos only update when the codestart action runs. Errors found during prediction, before the opening tag is consumed, are reported against the previous block.

Goal: syntax errors use the same coordinates as validation errors in all three runtimes, with shared fixtures in tests/.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions