Skip to content

1.2.0

Latest

Choose a tag to compare

@tinkerer-red tinkerer-red released this 09 May 21:22
· 26 commits to master since this release

New features

  • Batch compilation API. compile_batch() with a GMLC_BatchResult return 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/new sites reject non-callable values with a proper error. Stops things like 1280("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, and lineString fields instead of a baked in message string, and compile() accepts an optional _name so 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 GMLC instead of GMLCompiler.

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 42 now expands in expression contexts the way native GML does. (Allows you to override exposed functions, constants, keywords, etc like you can in native gml)
  • new through dot accessors. new foo.bar() now compiles; previously the new expression required a literal identifier as the callee.
  • #endregion with a closer title. #endregion MySection is now consumed properly, and comments and code that follow are parsed normally.
  • Explicit positive unary. +123 and +val was 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.
  • return parsing conditionals. return a = b was being parsed as an assignment expression which returns undefined, it now properly is parsed as a conditional expression. Bare return followed by a newline, keyword, or closing bracket is also handled.
  • Compound assignment on unique variables. +=, -=, etc. on built ins like visible and instance_count now route through the proper getter/setter, and reads of unique variables go through the registered with (global.gmlc_self_instance) scope rather than auto binding to whatever self instance happened to be.
  • Constructor parent guard. parentConstructorCall is now checked with is_handle && is_callable before 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 ;\//comment and other strange non-standardized syntax commonly found in Juju's work (meaning most of his libraries are now completely working)
  • [$f struct accessor. The tokenizer no longer mis-reads [$f as 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 [$f was 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 #endregion not being parsed 0133c9c
  • explicit positive unary expressions no longer crashing examples: +123, +val af8c116
  • 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 log functions removed 045e818
  • Merge branch 'master' of https://github.com/tinkerer-red/GMLC 590d88a
  • Added "Missing SNAP" Error Message e2cf660