Skip to content

v0.9.0

Compare
Choose a tag to compare
@mulias mulias released this 28 Oct 22:08
· 58 commits to main since this release
  • Introduces $ as a value label prefix. The value label indicates that the prefixed expression is a value. Any value may be labeled, but the value label is required for string literals, number literals, true, false, and null, but only when used in a context where the value could accidentally be interpreted as a parser. For example record2(Key1, value1, Key2, value2) used to be callable as record2("foo", foo_value, "bar", bar_value), but now must be invoked as record2($"foo", foo_value, $"bar", bar_value). This makes it explicit that "foo" and "bar" are string values, not parsers.
  • Improve json_string parser, add a bunch of tests for handling encoding/decoding edge cases.
  • Add @Codepoint(HexStr) meta function to convert a hexadecimal number encoded as a string into a UTF-8 unicode codepoint.
  • and @SurrogatePairCodepoint(High, Low) meta functions to convert two hexadecimal numbers encoded as strings into a UTF-16 surrogate pair codepoint.
  • Add hex_numeral, hex_digit, find_all(p), maybe_find_all(p), chars_until(stop), json_number, json_boolean, and json_null to the standard library.
  • Add True, False, Null, Inc(N), Dec(N) to the standard library.
  • Change ast_op_precedence(op_node, BindingPower) to AstOpPrecedence(OpNode, BindingPower) and change ast_infix_op_precedence(op_node, LeftBindingPower, RightBindingPower) to AstInfixOpPrecedence(OpNode, LeftBindingPower, RightBindingPower). Unfortunately the value label change made precedence parsing code look noisier, since all the binding power numbers had to be prefixed with $. Using value functions is a bit better.

Full Changelog: v0.8.0...v0.9.0