Skip to content

REPL: bare STATUS command fails with parse error (documented but not in grammar) #470

@retran

Description

@retran

Description

The HELP output documents status as a connection command ("Show connection status"), and the REPL's isCompleteStatement() recognizes it as a simple command. However:

  1. Bare STATUS fails with parse error because STATUS is a lexer keyword, not IDENTIFIER, so it doesn't match helpStatement: IDENTIFIER (identifierOrKeyword)*
  2. SHOW STATUS parses (grammar has showOrList STATUS) but produces no output — the visitor's ExitShowStatement only checks for STATUS inside the CATALOG branch, never routing to StatusStmt
  3. The ExitHelpStatement case "status" at visitor_query.go:1036 is dead code

Steps to Reproduce

# Via -c
mxcli -c "STATUS"
# Parse error: extraneous input 'STATUS'

# Via pipe
echo "SHOW STATUS" | mxcli -p project.mpr
# Connected to: ... (no status output)

Expected

STATUS or SHOW STATUS should print connection status (path, version, module count) as documented in HELP.

Root Cause

  • STATUS token (lexer keyword) doesn't match IDENTIFIER in helpStatement rule
  • ExitShowStatement visitor has no branch for bare ctx.STATUS() (only ctx.CATALOG() + ctx.STATUS())
  • execStatus() in executor_connect.go:105-123 is functional but unreachable

Affected Files

  • mdl/grammar/MDLParser.g4 — needs standalone STATUS in utilityStatement or route via showStatement
  • mdl/visitor/visitor_query.goExitShowStatement missing STATUS branch; ExitHelpStatement case "status" is dead
  • mdl/repl/repl.go:294 — lists "status" in simpleCommands (correct intent)

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