Skip to content

[ENHANCEMENT/FIX] Add extensions and optional fields parsing and fix class syntax parsing for typedefs.#289

Merged
EliteMasterEric merged 2 commits intoFunkinCrew:experimentalfrom
Starexify:correct-typedefs
Feb 4, 2026
Merged

[ENHANCEMENT/FIX] Add extensions and optional fields parsing and fix class syntax parsing for typedefs.#289
EliteMasterEric merged 2 commits intoFunkinCrew:experimentalfrom
Starexify:correct-typedefs

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
@EliteMasterEric
Copy link
Member

Resolves the issue 👍

@EliteMasterEric EliteMasterEric merged commit dbbabe1 into FunkinCrew:experimental Feb 4, 2026
@Starexify Starexify deleted the correct-typedefs branch February 4, 2026 16:43
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