Socket
Socket
Sign inDemoInstall

snapdragon-lexer

Package Overview
Dependencies
6
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

4.0.0

Diff

jonschlinkert
published 3.1.0 •

jonschlinkert
published 3.0.0 •

Changelog

Source

[3.0.0] - 2018-01-11

Breaking changes

  • removed lexer.last()
  • bumped snapdragon-stack, which has replaced all getters with methods that must be called.
jonschlinkert
published 2.0.0 •

Changelog

Source

[2.0.0] - 2018-01-08

Breaking changes

The following changes were made in an effort to make the API closer to other popular parsing libraries, such as babel and acorn.

  • Renamed token.val to token.value
  • lexer.loc.column was changed from a 1-index number to a 0-index number
  • .current is now a property set by the .handle() method. The value of lexer.current is whatever is returned by a handler.
  • .prev() now returns the previously lexed token
  • .push()

Added

  • If lexer.options.mode is set to character, lexer.advance() will consume and return a single character each time it's called, instead of iterating over the handlers.
  • the token.match array is now decorated with a .consumed property, which is the value of lexer.consumed before the match was created.
  • adds lexer.stack for tracking opening/closing structures
  • adds lexer.stash for storing an array of strings (in addition to lexer.tokens, which stores objects)
  • adds .append
  • adds .skipWhile
  • adds .skipSpaces
jonschlinkert
published 1.0.0 •

Changelog

Source

[1.0.0] - 2017-11-30

  • run update
  • update code comments, add .skipType method
  • add examples
  • update metadata and urls
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc