Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CST tools #252

Merged
merged 8 commits into from
Apr 11, 2021
Merged

Add CST tools #252

merged 8 commits into from
Apr 11, 2021

Commits on Apr 3, 2021

  1. feat!: Turn the lexer into a generator

    BREAKING CHANGE: The `push` argument of `new Lexer()` is dropped, and
    instead its `lex()` method is now a Generator<string> that allows for
    the lexemes to be iterated.
    eemeli committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    7526509 View commit details
    Browse the repository at this point in the history
  2. feat!: Turn the parser into a generator

    BREAKING CHANGE: The `push` argument of `new Parser()` is dropped, and
    instead its `parse()`, `next()` and `end()` methods are now generators
    that allow for the parsed tokens to be iterated.
    eemeli committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    7169dce View commit details
    Browse the repository at this point in the history
  3. feat!: Turn the composer into a generator

    Adds a convenience method `composer.compose(tokens)`.
    
    BREAKING CHANGE: The `push` argument of `new Composer()` is dropped, and
    instead its `next()` and `end()` methods are now generators that allow
    for the parsed documents to be iterated.
    eemeli committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    1755d2f View commit details
    Browse the repository at this point in the history
  4. refactor!: Rename parse/tokens.ts as parse/cst.ts

    BREAKING CHANGE: The public export is renamed from `tokens` to `CST`.
    eemeli committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    725dbf3 View commit details
    Browse the repository at this point in the history
  5. fix(cst): For block scalars, use an empty string rather than `undefin…

    …ed` to mark empty values
    eemeli committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    3742130 View commit details
    Browse the repository at this point in the history
  6. feat(cst): Add visitor & stringifier + utilities

    Adds:
    - `CST.isCollection(token)`
    - `CST.isScalar(token)`
    - `CST.stringify(cst)`
    - `CST.visit(cst, visitor)`
    eemeli committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    9deb055 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3f29b99 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2044c08 View commit details
    Browse the repository at this point in the history