You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7.5 KiB
7.5 KiB
- Commit history: https://github.com/pegjs/pegjs/commits/master
- Previous changelogs: https://github.com/pegjs/pegjs/tree/master/docs/changelogs
- Contributors this release: https://github.com/pegjs/pegjs/graphs/contributors?from=2016-08-20
This is a work in progress changelog for the next release (currently v0.11).
Major Changes
- Implemented value plucking: e.g. When
grammar = "-" @$[a-z]i* "-"
is given-PEGjs-
, it returnsPEGjs
- Upgraded JavaScript support:
- Parser's are generated in ES5
- Source code for PEG.js and scripts in the repository are written in ES2015, for Node 8+
- The browser release is in ES5, generated using Rollup and Babel
- Dropped support for Node versions 0.x, 4, 6 and non-LTS versions (e.g.
7
,9
, etc) - Dropped support for IE versions 8, 9 and 10
- Updated documentation:
- extracted to separate markdown files in the docs folder
- better explanation about error messages
- added documentation for case-insensitivity in grammar
- added documentation for backtracking in grammar
- clarify details for the execution environment for actions (#531)
- added a clear explanation of balanced braces (#533)
- updated documentation for the JavaScript API
- added a guide for plugins
- added documentation for tracer usage
- added a guide for the CLI
- Rewrote command line tool:
- added 2 aliases for
--extra-options-file
:-c
and--config
- options can accept their values via the assignment operator (e.g.
pegjs -c=config.js
) - all arguments after
--
are passed tooptions["--"]
- added aliases for some CLI options; Check them out using
pegjs -h
- added "bare" to accepted module formats
- added 2 aliases for
- Updated the helpers providable to the generated parsers:
- reintroduced
offset()
which was removed in a previous release (#528) - added
range()
; returns[starting offset, current offset]
location()
also returns afilename
property if one was passed to the generated parser as an option (#421)- helpers can be disabled via the new
features
option (e.g.{ text: false }
will remove thetext()
helper)
- reintroduced
- Parser returns an instance of the new Grammar class instead of a plain JavaScript object
- Added the ASTVisitor class (#451)
- Moved all code generation from the
generateBytecode
pass to thegenerateJs
pass (#459) - Use
.js
files with the--extra-options-file
(aliased by-c
and--config
) option on CLI - Added the Session API (
peg.compiler.Session
); this should simplify extending PEG.js using plugins - Implemented warning and error emitters:
session.warn
,session.error
andsession.fatal
(#327, #430, #431)
Minor Changes
- Omit PEG.js version from the browser release's filename
- Added support for generating the parser as a ES module using
"format": "es"
- Added bundled TypeScript declaration files for
- the PEG.js API:
pegjs/typings/api.d.ts
- the PEG.js modules:
pegjs/typings/modules.d.ts
- generated parsers:
pegjs/typings/generated-parser.d.ts
- the PEG.js API:
- Updated bytecode generator; Generated parsers look slightly better
- Added
ASTVisitor.on.{property,children}
; these are helper's to create visitor's for use with the new ASTVisitor class - Merged ast utility functions into the new Grammar class; faster and simpler to use now.
- Pass
options.parser
frompeg.generate
to the PEG.js parser (peg.parser
, or a custom parser) - Added a pass for the compiler to warn when unused rules are found (#200)
- Added a
header
option to the compiler; Adds custom comments to the header of the generated parser - CLI restores original output file (if it already exists) when parser generation fails
- Added the option
extractComments
to the PEG.js parser which if true will extract comments from the grammar (#511) - Made the default tracer optional (disabled like so
peg.generate(grammar, { features: { DefaultTracer: false } })
) - Pass variables to generated parsers through the
context
option whenoutput: "parser"
(#517) - On the CLI added the use of
input
andoutput
from the config file instead of passing them as arguments - Updated examples
- Upgraded support for Unicode (from v8 to v11)
Bugfixes
- Report consistent errors on look ahead + cached results (fix's #452 via #555)
- Improve error messages (#194, #475, #534, #547, #552)
- Do not indent backtick quoted strings in code blocks (#492)
- Fix shadowing issue for UMD generated parsers (#499)
- Check rules from
options.allowedStartRules
exist within the grammar (#524)
Internal
- Use ESLint to enforce code style
- Switch from Jasmine to Mocha & Chai (#409)
- Removed Makefile (Had switched to Gulp, but removed that as well); Using the scripts field of
package.json
instead - Rewrote
tools/impact
; previously a bash script that required external programs, it's now a cross-platform Node script - Added coverage via Istanbul, coveralls.io and codeclimate.com (#546, #596)
- Updated spec tests
- Switched to Yarn for workspace based development (NOTE: Yarn should not be required for production use)
- Updated keywords for the NPM package
- Moved source code for the website into the main repository; the website is updated as repo is updated now
- Added the spec and benchmark tests to the website
- Switch from Browserify to Rollup
- Auto-import PEG.js version using
require("pegjs/package.json")
, and on dist generation use rollup-plugin-json - Added https://pegjs.org/development/try; an editor that uses the latest source files for PEG.js
- Replaced Travis CI support with Azure Pipelines (#596)