Skip to content

Conversation

@Starexify
Copy link

@Starexify Starexify commented Jan 26, 2026

This PR adds correct parsing for optional and extensions in typedefs.

For example this snippet:

typedef TestTypedef = {
	var id:Int;
	var data:T;
	var ?version:Float;
}

typedef ExtendedTypedef = {
	> TestTypedef,
	var description:String;
}

The hscriptpolymod parser would complain (images below) about the unexpected > and ? symbols before, but now it parses correctly the extensions and optional fields like version.

image image

Extra

Also fixes the class syntax parsing of typedefs

The example code:

typedef TypedefData = {
  public var artist:String;
  private var privates:String;
  //static var renders:Array<String>;
  var strings:Array<String>;
  final finals:Array<String>;
}

Before:

image

After:

image

static context doesnt work in typedefs so I didn't allow it to get parsed

@Starexify Starexify changed the title [ENHANCEMENT] Add extensions and optional fields parsing for typedefs. [ENHANCEMENT/FIX] Add extensions and optional fields parsing and fix class syntax parsing for typedefs. Jan 31, 2026
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.

1 participant