Skip to content

v0.2.0

Compare
Choose a tag to compare
@kddnewton kddnewton released this 21 Oct 20:47
· 5618 commits to main since this release
906b5b3

Lots of updates since the last release 2 weeks ago, so I felt like it was time for another tag.

  • I updated the codebase to try to enforce a little consistency in the function naming. Basically each struct should have an _alloc, _init, and _free variant. By separating out _alloc and _init it makes it a little more clear what's going on when some structs can be either nested or living on their own.
  • I tried to simplify the config a bit to make it more maintainable going forward. The list of nodes is growing and it's getting more difficult to read at a glance. I also added comments to all of the nodes that we have so far to hopefully better communicate what they each mean semantically.
  • I've added tokens that can be optional on nodes, which means we now have a YP_TOKEN_NOT_PROVIDED. This token type is meant to indicate that a token could be here but wasn't found in the source and it's not an error (think parentheses on method calls).
  • I added some code to walk the tree in C and prettyprint the nodes/tokens/strings. It makes it much easier to debug what's going on when developing.
  • We're now using rake to handle everything, which makes for a much streamlined development experience. Thanks @tenderlove!
  • We now correctly parse superclasses, after fixing a binding power issue.
  • I started work on encodings. We have ASCII and UTF-8 baked in now. I'm not 100% sure if this is the way I actually want to go, but it works for now. Lots more experimentation needed on this.

Now for the new nodes:

  • BreakNode, NextNode, SuperNode, YieldNode
  • ForwardingSuperNode
  • StringListNode, StringNode, InterpolatedStringNode, StringInterpolatedNode
  • ConstantPathWriteNode
  • RangeNode
  • DefinedNode
  • ElseNode
  • DefNode
  • RequiredParameterNode, OptionalParameterNode, KeywordParameterNode

And a couple of changes:

  • CharacterLiteralNode no longer exists, as it's just a StringNode.
  • CallNode now works for methods with ? and !, operators of ::, and the .() shorthand
  • CallNode now tracks its parentheses