Skip to content

Commit 7db903f

Browse files
akoclaude
andcommitted
feat: unify MODIFY ATTRIBUTE syntax to accept colon separator (#81)
The MODIFY ATTRIBUTE syntax was inconsistent with CREATE ENTITY and ADD ATTRIBUTE which both use colon (Name: Type). MODIFY ATTRIBUTE used space (Name Type). Update the grammar to accept an optional colon in MODIFY ATTRIBUTE and MODIFY COLUMN, making colon the recommended style: ALTER ENTITY Module.Customer MODIFY ATTRIBUTE Address: String(500); Both syntaxes remain valid for backward compatibility: MODIFY ATTRIBUTE Name: String(200) -- new (preferred) MODIFY ATTRIBUTE Name String(200) -- old (still accepted) Updated all examples and skills to use colon consistently, aligning with CREATE ENTITY, ADD ATTRIBUTE, microflow parameters, and page parameters. Fixes #81 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 59c2903 commit 7db903f

File tree

5 files changed

+5847
-5803
lines changed

5 files changed

+5847
-5803
lines changed

docs/06-mdl-reference/grammar-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,8 +2877,8 @@ alterEntityAction
28772877
| | ADD COLUMN attributeDefinition
28782878
| | RENAME ATTRIBUTE IDENTIFIER TO IDENTIFIER
28792879
| | RENAME COLUMN IDENTIFIER TO IDENTIFIER
2880-
| | MODIFY ATTRIBUTE IDENTIFIER dataType attributeConstraint*
2881-
| | MODIFY COLUMN IDENTIFIER dataType attributeConstraint*
2880+
| | MODIFY ATTRIBUTE IDENTIFIER ':'? dataType attributeConstraint*
2881+
| | MODIFY COLUMN IDENTIFIER ':'? dataType attributeConstraint*
28822882
| | DROP ATTRIBUTE IDENTIFIER
28832883
| | DROP COLUMN IDENTIFIER
28842884
| | SET DOCUMENTATION STRING_LITERAL

mdl-examples/doctype-tests/01-domain-model-examples.mdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,11 +1363,11 @@ ALTER ENTITY DmTest.Settings
13631363

13641364
-- Widen a string attribute.
13651365
ALTER ENTITY DmTest.Document
1366-
MODIFY ATTRIBUTE Summary String(1000);
1366+
MODIFY ATTRIBUTE Summary: String(1000);
13671367

13681368
-- Change multiple attribute types in one statement.
13691369
ALTER ENTITY DmTest.SimpleTag
1370-
MODIFY ATTRIBUTE Name String(200);
1370+
MODIFY ATTRIBUTE Name: String(200);
13711371

13721372
-- ============================================================================
13731373
-- Level 10.4: DROP ATTRIBUTE

mdl/grammar/MDLParser.g4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ alterEntityAction
696696
| ADD COLUMN attributeDefinition
697697
| RENAME ATTRIBUTE attributeName TO attributeName
698698
| RENAME COLUMN attributeName TO attributeName
699-
| MODIFY ATTRIBUTE attributeName dataType attributeConstraint*
700-
| MODIFY COLUMN attributeName dataType attributeConstraint*
699+
| MODIFY ATTRIBUTE attributeName COLON? dataType attributeConstraint*
700+
| MODIFY COLUMN attributeName COLON? dataType attributeConstraint*
701701
| DROP ATTRIBUTE attributeName
702702
| DROP COLUMN attributeName
703703
| SET DOCUMENTATION STRING_LITERAL

mdl/grammar/parser/MDLParser.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)