Repository navigation
New features
- Batch compilation API.
compile_batch()with aGMLC_BatchResultreturn type lets you compile many GML sources in a single pass and surfaces per file success/failure data. - Cross file enums and macros. Enums and macros declared in one source are now hoisted into the batch context so other sources in the same batch can reference them, matching how a real GameMaker project resolves these.
- Sandboxed function calling. Functions exposed to the environment are now bound with
method(undefined, ...), and call/newsites reject non-callable values with a proper error. Stops things like1280("show debug message")from being treated as a valid call when a constant gets shadowed, and prevent breaking out of the exposed methods. - Structured error objects. Thrown errors now carry separate
script,line,column, andlineStringfields instead of a baked in message string, andcompile()accepts an optional_nameso the error knows which file it came from. - "Missing SNAP" diagnostic. Friendlier message when SNAP isn't installed, instead of an opaque crash.
- Library folder rename. Resource folder is now
GMLCinstead ofGMLCompiler.
Parity with native GML
- Reserved words and unique variables as struct keys.
{ self: 1, other: 2, global: 3, undefined: 4, for: 5, true: 6, false: 7 }and reading them back via dot accessor or[$ ...]struct accessor now works the way it does in real GML (the key becomes the literal string). - Reserved words and constants as enum members.
enum Foo { self },enum Foo { undefined }, and friends now parse and resolve correctly. - Macros shadowing built in function names. A
#macro string_length 42now expands in expression contexts the way native GML does. (Allows you to override exposed functions, constants, keywords, etc like you can in native gml) newthrough dot accessors.new foo.bar()now compiles; previously the new expression required a literal identifier as the callee.#endregionwith a closer title.#endregion MySectionis now consumed properly, and comments and code that follow are parsed normally.- Explicit positive unary.
+123and+valwas originally crashing, now officially supported.
Bug fixes
- Method calling through dot accessors. Long standing resolution bug for
a.b.c()style calls fixed. - Tokenizer crash on non-ASCII. Keyword/function/constant/variable trie lookups now skip bytes >= 256 instead of indexing out of range, so source containing Unicode no longer takes the tokenizer down.
returnparsing conditionals.return a = bwas being parsed as an assignment expression which returns undefined, it now properly is parsed as a conditional expression. Barereturnfollowed by a newline, keyword, or closing bracket is also handled.- Compound assignment on unique variables.
+=,-=, etc. on built ins likevisibleandinstance_countnow route through the proper getter/setter, and reads of unique variables go through the registeredwith (global.gmlc_self_instance)scope rather than auto binding to whateverselfinstance happened to be. - Constructor parent guard.
parentConstructorCallis now checked withis_handle && is_callablebefore being invoked, so constructors with a missing parent reference no longer hard crash, but instead will properly throw a gmlc error. - macro edge case. Block parser now bails out cleanly when an optional
;consume eats the last token before}, fixing a niche failure with Juju Adams' coroutines library macros. This also happens to fix several other macro expansion bugs specifically relating to using;\//commentand other strange non-standardized syntax commonly found in Juju's work (meaning most of his libraries are now completely working) [$fstruct accessor. The tokenizer no longer mis-reads[$fas a[followed by the hex number$f; it's correctly a struct accessor opener.
Full Changelog: 1.1.1...1.2.0
Commits:
- resolved keywords in struct keys #106 9aa912e
- fixed internal function literals not being methoded c5416a9
- fixed a bug where unique variables were automatically bound to calling instance instead of relying on the calling method exposed. 7f2c547
- Merge branch 'master' of https://github.com/tinkerer-red/GMLC 565479a
- fixed return statements not parsing conditional expressions was
=should be==ac030ab - Create release workflow in release.yml 041a1f4
- Library clean up 86fed7e
- fixed a feather issue 49a92dc
- Properly Sandboxed Function calling preventing
1280("show debug message)b4e879e - improved error handling 74ce561
- fixed a very niche bug relating to juju coroutines library macros. f492227
- improved logging 91b67af
- vast improvements to enums and macros across multiple file parsing 6935fdf
- fixed an issue where
[$fwas being parsed as a[and a hex number, instead of a struct accessor d8adca2 - fixed a bug where new expressions were requiring a literal identifier and accessors were not being supported. ex:
new foo.bar()d04165b - Fixed unique variables in assignment ops, and get scoping 0c59397
- fixed comment block after
#endregionnot being parsed 0133c9c - explicit positive unary expressions no longer crashing examples:
+123,+valaf8c116 - minor logging changes for debugging b63b4dc
- Fixed tokenizer not properly handling non-ascii in keywords b080507
- Merge branch 'master' of https://github.com/tinkerer-red/GMLC a2b09d8
- Fixed a long standing bug relating to how method calling through dot accessors was resolved. 37b42bf
- Add new GML interpreter link to README 434e580
- more
logfunctions removed 045e818 - Merge branch 'master' of https://github.com/tinkerer-red/GMLC 590d88a
- Added "Missing SNAP" Error Message e2cf660