Skip to content

Editor grammar rejects quoted method names (A."some method"()) the renderer accepts #810

Description

@MrCoder

Summary

The editor's Lezer grammar rejects quoted (string) method names like A."some method"(),
which the renderer accepts. ZenUML uses quoted method names for spaced/multi-word method labels,
and this is one of the two false-positive cases explicitly blocking in-editor error feedback
(see web/src/editor/modes.ts — the Lezer linter is disabled partly because of "the shipped
quoted-method-name templates").

Steps to reproduce

Type A."some method"() (or A."do it"() { B.c() }).

Expected vs Actual

Input Lezer (editor) ANTLR (renderer)
A.method() ok ok
A."some method"() ERROR (2 nodes) ok
A."m"() ERROR ok
A.方法() ok (Unicode, fixed by #809) ok

Location

web/src/editor/grammar/zenuml.grammar ~line 361:

MethodName { !call Identifier }

Accepts only an Identifier; a String method name fails.

Fix sketch

MethodName { !call (Identifier | String) }

(String token already exists. Same pattern as #808's Label fix.) Regenerate the parser; verify
A."some method"() parses with 0 error nodes, conformance subset holds, and A.method() /
A.方法() still parse.

Why it matters

This is the LAST of the two named false-positive blockers in modes.ts (the other,
declare-then-message, already parses cleanly). Closing it clears the way to wiring the
already-built zenumlLinter and giving users real in-editor error feedback.

Found via the editor-improvement campaign (grammar-gap hunt toward enabling error feedback).

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions