Skip to content

v0.9.0

Choose a tag to compare

@kddnewton kddnewton released this 26 Aug 00:23
a17a373

Added

  • Regular expressions can now be bound by \n, \r, and a combination of \r\n.
  • Strings delimited by %, %q, and %Q can now be bound by \n, \r, and a combination of \r\n.
  • IntegerNode#value now returns the value of the integer as a Ruby Integer.
  • FloatNode#value now returns the value of the float as a Ruby Float.
  • RationalNode#value now returns the value of the rational as a Ruby Rational.
  • ImaginaryNode#value now returns the value of the imaginary as a Ruby Complex.
  • ClassNode#name is now a string that returns the name of just the class, without the namespace.
  • ModuleNode#name is now a string that returns the name of just the module, without the namespace.
  • Regular expressions and strings found after a heredoc declaration but before the heredoc body are now parsed correctly.
  • The serialization API now supports shared strings, which should help reduce the size of the serialized AST.
  • *Node#copy is introduced, which returns a copy of the node with the given overrides.
  • Location#copy is introduced, which returns a copy of the location with the given overrides.
  • DesugarVisitor is introduced, which provides a simpler AST for use in tools that want to process fewer node types.
  • {ClassVariable,Constant,ConstantPath,GlobalVariable,InstanceVariable,LocalVariable}TargetNode are introduced. These nodes represent the target of writes in locations where a value cannot be provided, like a multi write or a rescue reference.
  • UntilNode#closing_loc and WhileNode#closing_loc are now provided.
  • Location#join is now provided, which joins two locations together.
  • YARP::parse_lex and YARP::parse_lex_file are introduced to parse and lex in one result.

Changed

  • When there is a magic encoding comment, the encoding of the first token's source string is now properly reencoded.
  • Constants followed by unary & are now properly parsed as a call with a passed block argument.
  • Escaping multi-byte characters in a string literal will now properly escape the entire character.
  • YARP.lex_compat now has more accurate behavior when a byte-order mark is present in the file.
  • BREAKING: AndWriteNode, OrWriteNode, and OperatorWriteNode have been split back up into their 0.7.0 versions.
  • We now properly support spaces between the encoding and =/: in a magic encoding comment.
  • We now properly parse -> foo: bar do end.