Skip to content

Quoted attribute segment in nav expressions ($Var/"Attr") parses but is invalid Mendix syntax #827

Description

@MendixMau

Environment: mxcli (RnD/upstream, commit 504aec6) and engalar/mxcli (commit 26f2866),
Mendix 11.12.0 project (EmptyTest base). Both forks behave identically.

Steps to reproduce:

create module ZKT29;
/
create entity ZKT29."TestEntity" (
	"Attr1": String
);
/
create microflow ZKT29."MF_Test" () returns Boolean
begin
	$Obj = create ZKT29."TestEntity";
	if $Obj/"Attr1" = 'x' then
		return true;
	else
		return false;
	end if;
end

Run mxcli check script.mdl, then mxcli exec script.mdl -p EmptyTest.mpr.

Expected behavior: Given this project's own convention of "always quote identifiers" (see
CLAUDE.md), a user is likely to reflexively quote the attribute segment of a nav-path expression
too. mxcli's checker should catch that this is invalid — either reject it as a syntax error, or
warn at check time — matching how the domain-model grammar knows to reject "ChangedBy" /
"Owner" / "Type" as attribute names.

Actual behavior: Both check and exec accept the quoted form silently on both mxcli forks
and write it into the .mpr's microflow expression text unmodified. The project's own
documentation states this then fails at mx check (mxbuild) with CE0117, i.e. the model is
invalid, but neither fork's own checker catches it before that point.
(Could not re-verify the CE0117 failure directly against a live mxbuild run in this session —
mxbuild's Linux binary would not execute in the available macOS + Docker environment within a
reasonable time; recommend the reporter re-confirm with a working mxbuild setup if that matters
for triage.)

Root cause (from grammar inspection): attributePath in both forks is
VARIABLE ((SLASH | DOT) qualifiedName)+, and qualifiedName permits QUOTED_IDENTIFIER
segments generically. The fix should restrict the segment(s) after / in an attributePath to
an unquoted attributeName-only rule (or add a semantic-validation pass that rejects
QUOTED_IDENTIFIER there), consistent with how attribute definitions already reserve quoting
for entity/module names, not attribute references.

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