Skip to content

v0.5.1

Compare
Choose a tag to compare
@hydroper hydroper released this 18 Apr 16:09
· 161 commits to master since this release

Specific range of characters

Now, the parser is able to parse a specific range of characters from an existing compilation unit by passing the byte_range option.

let parser = ParserFacade(&compilation_unit, ParserOptions {
    byte_range: Some((first_offset, last_offset)),
    ..default()
});

if let Some(directives) = parser.parse_directives(context) {
    // Action
}

The following restrictions were shifted off thanks to this:

  • You had to create a different compilation unit when parsing, for example, ActionScript 3 nested in XML.
  • The parser itself used to create different compilation units for parsing ActionScript 3 references inside ASDoc. This is now solved by simply passing the above byte_range options.

Structure changes

There were a number of renaming of existing structures and moves across modules to cleanup the parser.

The ParserFacade is now used just slightly differently from before (now you supply options and then invoke one of its instance methods such as .parse_program()).

ASDoc locations

  • Now, references within ASDoc comments, such as these in @see, represent expression nodes containing the correct location at the same enclosing compilation unit.
  • Now, the #x part of an ASDoc reference, such as in @copy and @see, contains the source location for the x name. #q::x also works.

Tree semantics

The parser now comes with a TreeSemantics structure that allows efficiently mapping meanings to nodes, usually used by a compiler.

MXML

Average parsing of MXML is integrated within the parser, parsing only UTF-8 and XML version 1.0.

CSS

Support for parsing the CSS3 subset of Flex might be integrated within this project.