Skip to content

Latest commit

History

History
57 lines (44 loc) · 1.55 KB

File metadata and controls

57 lines (44 loc) · 1.55 KB

TechScript 2.0 Migration Guide

This guide describes how to update legacy TechScript 1.0.8 projects to use the clean canonical syntax of TechScript 2.0.


📐 Overview of Key Syntax Changes

TechScript 2.0 simplifies syntax by eliminating legacy variable keywords (make, keep) and aligns control loop commands with standard conventions:

TechScript 1.0.8 LegacyTechScript 2.0 CanonicalDescription
make name = "Alice"name = "Alice"Variable keyword removed.
make name be "Alice"name = "Alice"be keyword deprecated.
keep PI = 3.14const PI = 3.14Use const for immutables.
model Dog ... endclass Dog ... endUse class instead of model.
attempt ... endtry ... endUse standard try/catch.
stopbreakTerminate loop execution.
skipcontinueSkip to next loop iteration.
each item in listfor item in listEnforce for loops.

🧬 Code Migration Examples

Variables & Constants

# ❌ Legacy 1.0.8 Style (generates TSW1001 warnings)
make username = "Bob"
keep MAX_ITEMS = 50
# ✅ Modern 2.0.0 Style
username = "Bob"
const MAX_ITEMS = 50

Conditional Blocks

# ❌ Legacy 1.0.8 Style
when x equals y then
say "Equal"
end
# ✅ Modern 2.0.0 Style
when x == y
say "Equal"
end

🛠️ Automated Migration Command

You can auto-migrate old scripts using the built-in linter and formatter:

tech migrate .

This automatically updates legacy keywords to their modern counterparts.