Skip to content

Conversation

@Drake53
Copy link
Owner

@Drake53 Drake53 commented Jan 24, 2026

No description provided.

This commit brings in the complete Roslyn-style syntax tree architecture
for JASS from the vjass branch. This is a major architectural upgrade that
provides:

- Immutable syntax trees with full trivia support (whitespace, comments)
- Strongly-typed syntax kinds (447+ JassSyntaxKind values)
- Complete tree navigation (GetChild*/GetDescendant* methods)
- Code formatting via NormalizeWhitespace()
- Fluent builder API for programmatic code generation
- Enhanced parser with better error handling
- Performance optimizations

Key changes:
- New base classes: JassSyntaxNode, JassSyntaxToken, JassSyntaxTrivia
- Parser refactored from Parser/ to JassParser/ directory
- Converted from interfaces (IExpressionSyntax, etc.) to base classes
- Added normalizer system for code formatting
- Added syntax rewriter for code transformations
- Updated all renderers and renamers

Note: This introduces build errors due to missing War3Net.CodeAnalysis
changes that will be applied in the next commit.
This commit applies the necessary changes from the vjass branch to the
War3Net.CodeAnalysis project to support the new JASS syntax system.

Changes:
- Added SeparatedSyntaxList.IsEmpty property
- Added SeparatedSyntaxList.Create(item) method
- Added SeparatedSyntaxList.CreateBuilder(item, capacity) overload
- Added SeparatedSyntaxList.Builder(item, capacity) constructor
- Updated IfThenElseParser, SeparatedParser, and UntilWithLeadingParser
Changes to War3Net.CodeAnalysis.Jass:
- Added FunctionDeclarationParser property that throws NotImplementedException
  The new JASS syntax system doesn't support parsing function declarations
  in isolation (they require context for the optional 'constant' keyword).
  Users should use TopLevelDeclarationParser instead.

Changes to War3Net.TestTools.UnitTesting:
- Updated SyntaxAssert from vjass branch to use new base classes instead
  of removed interfaces (IExpressionSyntax, IStatementSyntax, etc.)
- Changed from NullableEquals() to NullableEquivalentTo() extension method
- Commented out methods for removed "Line" syntax types
- Updated TestDataProvider with improved error handling

All 127 JASS tests now pass.
@Drake53 Drake53 changed the title Rework JASS syntax classes. Update War3Net to v6.0.0 Jan 25, 2026
@Drake53 Drake53 marked this pull request as ready for review January 25, 2026 14:35
@Drake53 Drake53 merged commit 193ce5b into master Jan 25, 2026
1 check passed
@Drake53 Drake53 deleted the jass-rework branch January 25, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants