XMD Advanced Syntax Implementation Plan

Objective

Implement missing XMD language features to support advanced syntax in principles.md:

  • Array literals
  • Variable initialization without assignment
  • String concatenation operations
  • Enhanced import functionality

Current Issue

principles.md uses advanced XMD syntax that is not yet implemented:

set principles = ["test_driven.md", "isolation.md", ...]
set content
for principle in principles
    content += "### " + import principle + "\n\n"

Implementation Phases

Phase 1: Array Literal Support

  • Modify process_set to parse array literals ["item1", "item2"]
  • Update variable.h to support array types
  • Implement array creation functions

Phase 2: Variable Initialization

  • Support set varname (initialization without assignment)
  • Initialize as empty string by default

Phase 3: String Concatenation

  • Implement += operator for string concatenation
  • Implement + operator for string concatenation in expressions
  • Update expression parsing

Phase 4: Enhanced Import

  • Support import varname where varname contains filename
  • Enable import within expressions

Phase 5: Testing & Integration

  • Create comprehensive tests
  • Verify principles.md works correctly
  • Update documentation

Success Criteria

principles.md processes correctly with dynamic import and concatenation.