Debian Codegraph @

vendor/wikimedia/wikipeg/HISTORY.md

raw
1 # Release History
2
3 ## 4.0.2 (2025-04-28)
4 * Same as 4.0.0
5
6 ## 4.0.1 (2025-04-28)
7 * Unpublished.
8
9 ## 4.0.0 (2024-03-04)
10 * Use a class instead of an assoc array for cache entry
11 * Switch phan to special library mode
12 * PHP dependency updates (eslint, mediawiki-codesniffer, mediawiki-phan-config, phpunit)
13 * JS dependency updates (word-wrap)
14
15 ## 3.0.0 (2022-11-10)
16 * Drop class aliases for old \WikiPEG namespace.
17 * Bump minimum required PHP version to 7.4.3.
18 * Dependency updates (ansi-regex, eslint, minimatch; mediawiki-codesniffer,
19 mediawiki-phan-config, covers-validator, php-parallel-lint).
20 * This release should also be compatible with PHP 8.1.
21
22 ## 2.0.6 (2021-08-07)
23 * Changed package namespace from WikiPEG to Wikimedia\WikiPEG to match
24 composer package name. PHP's `class_alias` has been used so that existing
25 code using the old namespace will continue to work, but this is now
26 deprecated; it is expected that the next major release of WikiPEG will
27 remove the aliases.
28 * Dependency updates.
29 * Added a place in the template to add header comments.
30 * Add phpcs and reformat PHP code to MediaWiki codestyle.
31 * Add phan and fix minor issues.
32
33 ## 2.0.5 (2020-12-17)
34 * Add PHP 8.0 support plus better CI tests for the PHP code.
35
36 ## 2.0.4 (2020-02-13)
37 * Add .gitattributes file to reduce downloaded cruft when imported as a
38 library.
39 * Fix an obscure bug when the grammar contains cycles.
40 * Fix DefaultTracer: the location is a LocationRange object now.
41
42 ## 2.0.3 (2019-04-25)
43 * Move spec to tests/jasmine.
44 * Fix to error construction.
45 * Fix expectation sorting.
46 * Another fix for the ast.initializer format change.
47 * SyntaxError: correctly call parent constructor.
48 * Fix encoding of astral plane characters in string literals (PHP backend)
49 * Fix missing bracket in matchLiteral() (PHP backend)
50 * Add cross-language testing and fix JS generator bugs identified by it.
51 * Classes for Location, LocationRange, and Expectation (PHP backend)
52 * Fix TestRunner error() call
53 * Simplify loops zero_or_more and one_or_more
54 * Fix caching of reference rule variables.
55 * Better default keys for PHP and JS.
56
57 ## 2.0.2 (2019-04-25)
58 There is no 2.0.2.
59
60 ## 2.0.1 (2019-03-28)
61 Fix visitor for new multiple initializer feature
62
63 ast.initializer is now the same as before if there are 0 or 1
64 initializers, and an array if there are 2 or more. Update visitor for
65 this. During development I initially made it be an array
66 unconditionally, but I changed it to this more compatible format shortly
67 before merging in order to make the tests pass, but neglected to update
68 visitor.
69
70 ## 2.0.0 (2019-03-11)
71 PHP backend
72
73 Add a PHP code generation mode.
74
75 Mapping overview:
76
77 * File extension .pegphp hints to the binary that PHP is to be generated
78 * Generated PHP code depends on a PSR-4 runtime library directory. I
79 used "src" for this, and moved the one file that was there out to
80 lib/.
81 * JavaScript's enclosing scope is generally replaced by private and
82 protected members of the generated class or its parent. For example,
83 input becomes $this->input.
84 * PHP's offsets are byte offsets, not UTF-16 offsets as in JS. Rules
85 such as . (any) return a full UTF-8 character, by means of our own
86 simple UTF-8 decoder.
87 * The AST initializer is placed inside the definition of the generated
88 class, so private function declarations are appropriate, and
89 $this->input etc. is accessible.
90 * Actions and semantic predicates become private methods.
91
92 Changes:
93
94 * Add ported examples for arithmetic and CSS
95 * Remove the ability to run the generator in the browser. It is probably
96 still possible to use generated parsers in the browser.
97 * Merge common-helpers, trace-helpers and wrapper.js into a single
98 template file. The helper files were mostly there to support the
99 browser mode.
100 * Give actions a separate namespace from consts, since it's not
101 convenient in PHP to treat a function as a variable.
102 * To run the start rule, instead of a hashtable of closures, use a
103 switch statement. This is simpler and works in both languages. The
104 hashtable of closures made more sense when it was possible to run
105 start rules directly, but now we have to supply default parameters for
106 them, so there was already an extra proxy closure.
107 * Use template literals throughout, since they look very nice in this
108 use case and are presumably efficient.
109 * For streaming mode, use a generator instead of an iterator, since PHP
110 has generators using similar syntax to ES6, whereas PHP's iterator
111 syntax is quite different.
112 * Make the version 2.0.0.
113
114 ## 1.0.2 (2019-03-11)
115 * Fix file list in package.json and increment version.
116
117 ## 1.0.0 (2019-02-08)
118 * Call this WikiPEG 1.0.0.
119 * Rename the binary and NPM project.
120 * Remove documentation of the browser target since this is
121 now unmaintained.
122 * Require Node.js 6+, like Parsoid. The upcoming feature commit will use
123 some ES6 features.
124 * Retain the file extension .pegjs for now.
125
126 ## 0.8.0 (December 24, 2013)
127
128 ### Big Changes
129
130 * Completely rewrote the code generator. Among other things, it allows
131 optimizing generated parsers for parsing speed or code size using the
132 `optimize` option of the `PEG.buildParser` method or the `--optimize`/`-o`
133 option on the command-line. All internal identifiers in generated code now
134 also have a `peg$` prefix to discourage their use and avoid conflicts.
135 [[#35](https://github.com/dmajda/pegjs/issues/35),
136 [#92](https://github.com/dmajda/pegjs/issues/92)]
137
138 * Completely redesigned error handling. Instead of returning `null` inside
139 actions to indicate match failure, new `expected` and `error` functions can
140 be called to trigger an error. Also, expectation inside the `SyntaxError`
141 exceptions are now structured to allow easier machine processing.
142 [[#198](https://github.com/dmajda/pegjs/issues/198)]
143
144 * Implemented a plugin API. The list of plugins to use can be specified using
145 the `plugins` option of the `PEG.buildParser` method or the `--plugin`
146 option on the command-line. Also implemented the `--extra-options` and
147 `--extra-options-file` command-line options, which are mainly useful to pass
148 additional options to plugins.
149 [[#106](https://github.com/dmajda/pegjs/issues/106)]
150
151 * Made `offset`, `line` and `column` functions, not variables. They are now
152 available in all parsers and return lazily-computed position data. Removed
153 now useless `trackLineAndColumn` option of the `PEG.buildParser` method and
154 the `--track-line-and-column` option on the command-line.
155
156 * Added a new `text` function. When called inside an action, it returns the
157 text matched by action's expression.
158 [[#131](https://github.com/dmajda/pegjs/issues/131)]
159
160 * Added a new `$` operator. It extracts matched strings from expressions.
161
162 * The `?` operator now returns `null` on unsuccessful match.
163
164 * Predicates now always return `undefined`.
165
166 * Replaced the `startRule` parameter of the `parse` method in generated
167 parsers with more generic `options` parameter. The start rule can now be
168 specified as the `startRule` option. The `options` parameter can be also
169 used to pass custom options to the parser because it is visible as the
170 `options` variable inside parser code.
171 [[#37](https://github.com/dmajda/pegjs/issues/37)]
172
173 * The list of allowed start rules of a generated parser now has to be
174 specified explicitly using the `allowedStartRules` option of the
175 `PEG.buildParser` method or the `--allowed-start-rule` option on the
176 command-line. This will make certain optimizations like rule inlining easier
177 in the future.
178
179 * Removed the `toSource` method of generated parsers and introduced a new
180 `output` option of the `PEG.buildParser` method. It allows callers to
181 specify whether they want to get back the parser object or its source code.
182
183 * The source code is now a valid npm package. This makes using development
184 versions easier.
185 [[#32](https://github.com/dmajda/pegjs/issues/32)]
186
187 * Generated parsers are now ~25% faster and ~62%/~3% smaller (when optimized
188 for size/speed) than those generated by 0.7.0.
189
190 * Requires Node.js 0.8.0+.
191
192 ### Small Changes
193
194 * `bin/pegjs` now outputs just the parser source if the value of the
195 `--export-var` option is empty. This makes embedding generated parsers into
196 other files easier.
197 [[#143](https://github.com/dmajda/pegjs/issues/143)]
198
199 * Changed the value of the `name` property of `PEG.GrammarError` instances
200 from “PEG.GrammarError” to just “GrammarError”. This better reflects the
201 fact that PEG.js can get required with different variable name than `PEG`.
202
203 * Setup prototype chain for `PEG.GrammarError` correctly.
204
205 * Setup prototype chain for `SyntaxError` in generated parsers correctly.
206
207 * Fixed error messages in certain cases with trailing input
208 [[#119](https://github.com/dmajda/pegjs/issues/119)]
209
210 * Fixed code generated for classes starting with `\^`.
211 [[#125](https://github.com/dmajda/pegjs/issues/125)]
212
213 * Fixed too eager proxy rules removal.
214 [[#137](https://github.com/dmajda/pegjs/issues/137)]
215
216 * Added a license to all vendored libraries.
217 [[#207](https://github.com/dmajda/pegjs/issues/207)]
218
219 * Converted the test suite from QUnit to Jasmine, cleaning it up on the way.
220
221 * Travis CI integration.
222
223 * Various internal code improvements and fixes.
224
225 * Various generated code improvements and fixes.
226
227 * Various example grammar improvements and fixes.
228
229 * Improved `README.md`.
230
231 * Converted `CHANGELOG` to Markdown.
232
233 ## 0.7.0 (April 18, 2012)
234
235 ### Big Changes
236
237 * Added ability to pass options to `PEG.buildParser`.
238
239 * Implemented the `trackLineAndColumn` option for `PEG.buildParser` (together
240 with the `--track-line-and-column` command-line option). It makes the
241 generated parser track line and column during parsing. These are made
242 available inside actions and predicates as `line` and `column` variables.
243
244 * Implemented the `cache` option for `PEG.buildParser` (together with the
245 `--cache` command-line option). This option enables/disables the results
246 cache in generated parsers, resulting in dramatic speedup when the cache is
247 disabled (the default now). The cost is breaking the linear parsing time
248 guarantee.
249
250 * The current parse position is visible inside actions and predicates as the
251 `offset` variable.
252
253 * Exceptions thrown by the parser have `offset`, `expected` and `found`
254 properties containing machine-readable information about the parse failure
255 (based on a patch by Marcin Stefaniuk).
256
257 * Semantic predicates have access to preceding labels.
258 [[GH-69](https://github.com/dmajda/pegjs/issues/69)]
259
260 * Implemented case-insensitive literal and class matching.
261 [[GH-34](https://github.com/dmajda/pegjs/issues/34)]
262
263 * Rewrote the code generator — split some computations into separate passes
264 and based it on a proper templating system (Codie).
265
266 * Rewrote variable handling in generated parsers in a stack-like fashion,
267 simplifying the code and making the parsers smaller and faster.
268
269 * Adapted to Node.js 0.6.6+ (no longer supported in older versions).
270
271 * Dropped support for IE < 8.
272
273 * As a result of several optimizations, parsers generated by 0.7.0 are ~6.4
274 times faster and ~19% smaller than those generated by 0.6.2 (as reported by
275 `/tools/impact`).
276
277 ### Small Changes
278
279 * Fixed reported error position when part of the input is not consumed.
280 [[GH-48](https://github.com/dmajda/pegjs/issues/48)]
281
282 * Fixed incorrect disjunction operator in `computeErrorPosition` (original
283 patch by Wolfgang Kluge).
284
285 * Fixed regexp for detecting command-line options in `/bin/pegjs`.
286 [[GH-51](https://github.com/dmajda/pegjs/issues/51)]
287
288 * Generate more efficient code for empty literals (original patch by Wolfgang
289 Kluge).
290
291 * Fixed comment typos (patches by Wolfgang Kluge and Jason Davies).
292 [[GH-59](https://github.com/dmajda/pegjs/issues/59)]
293
294 * Fixed a typo in JavaScript example grammar.
295 [[GH-62](https://github.com/dmajda/pegjs/issues/62)]
296
297 * Made copy & paste inclusion of the PEG.js library into another code easier
298 by changing how the library is exported.
299
300 * Improved the copyright comment and the “Generated by...” header.
301
302 * Replaced `Jakefile` with `Makefile`.
303
304 * Added `make hint` task that checks all JavaScript files using JSHint and
305 resolved all issues it reported. All JavaScript files and also generated
306 parsers are JSHint-clean now.
307
308 * Fixed output printed during test failures (expected value was being printed
309 instead of the actual one). Original patch by Wolfgang Kluge.
310
311 * Added a `/tools/impact` script to measure speed and size impact of commits.
312
313 * Various generated code improvements and fixes.
314
315 * Various internal code improvements and fixes.
316
317 * Improved `README.md`.
318
319 ## 0.6.2 (August 20, 2011)
320
321 ### Small Changes
322
323 * Reset parser position when action returns `null`.
324
325 * Fixed typo in JavaScript example grammar.
326
327 ## 0.6.1 (April 14, 2011)
328
329 ### Small Changes
330
331 * Use `--ascii` option when generating a minified version.
332
333 ## 0.6.0 (April 14, 2011)
334
335 ### Big Changes
336
337 * Rewrote the command-line mode to be based on Node.js instead of Rhino — no
338 more Java dependency. This also means that PEG.js is available as a Node.js
339 package and can be required as a module.
340
341 * Version for the browser is built separately from the command-line one in two
342 flavors (normal and minified).
343
344 * Parser variable name is no longer required argument of `bin/pegjs` — it is
345 `module.exports` by default and can be set using the `-e`/`--export-var`
346 option. This makes parsers generated by `/bin/pegjs` Node.js modules by
347 default.
348
349 * Added ability to start parsing from any grammar rule.
350
351 * Added several compiler optimizations — 0.6 is ~12% faster than 0.5.1 in the
352 benchmark on V8.
353
354 ### Small Changes
355
356 * Split the source code into multiple files combined together using a build
357 system.
358
359 * Jake is now used instead of Rake for build scripts — no more Ruby
360 dependency.
361
362 * Test suite can be run from the command-line.
363
364 * Benchmark suite can be run from the command-line.
365
366 * Benchmark browser runner improvements (users can specify number of runs,
367 benchmarks are run using `setTimeout`, table is centered and fixed-width).
368
369 * Added PEG.js version to “Generated by...” line in generated parsers.
370
371 * Added PEG.js version information and homepage header to `peg.js`.
372
373 * Generated code improvements and fixes.
374
375 * Internal code improvements and fixes.
376
377 * Rewrote `README.md`.
378
379 ## 0.5.1 (November 28, 2010)
380
381 ### Small Changes
382
383 * Fixed a problem where “SyntaxError: Invalid range in character class.” error
384 appeared when using command-line version on Widnows
385 ([GH-13](https://github.com/dmajda/pegjs/issues/13)).
386
387 * Fixed wrong version reported by `bin/pegjs --version`.
388
389 * Removed two unused variables in the code.
390
391 * Fixed incorrect variable name on two places.
392
393 ## 0.5 (June 10, 2010)
394
395 ### Big Changes
396
397 * Syntax change: Use labeled expressions and variables instead of `$1`, `$2`,
398 etc.
399
400 * Syntax change: Replaced `:` after a rule name with `=`.
401
402 * Syntax change: Allow trailing semicolon (`;`) for rules
403
404 * Semantic change: Start rule of the grammar is now implicitly its first rule.
405
406 * Implemented semantic predicates.
407
408 * Implemented initializers.
409
410 * Removed ability to change the start rule when generating the parser.
411
412 * Added several compiler optimizations — 0.5 is ~11% faster than 0.4 in the
413 benchmark on V8.
414
415 ### Small Changes
416
417 * `PEG.buildParser` now accepts grammars only in string format.
418
419 * Added “Generated by ...” message to the generated parsers.
420
421 * Formatted all grammars more consistently and transparently.
422
423 * Added notes about ECMA-262, 5th ed. compatibility to the JSON example
424 grammar.
425
426 * Guarded against redefinition of `undefined`.
427
428 * Made `bin/pegjs` work when called via a symlink
429 ([issue #1](https://github.com/dmajda/pegjs/issues/1)).
430
431 * Fixed bug causing incorrect error messages
432 ([issue #2](https://github.com/dmajda/pegjs/issues/2)).
433
434 * Fixed error message for invalid character range.
435
436 * Fixed string literal parsing in the JavaScript grammar.
437
438 * Generated code improvements and fixes.
439
440 * Internal code improvements and fixes.
441
442 * Improved `README.md`.
443
444 ## 0.4 (April 17, 2010)
445
446 ### Big Changes
447
448 * Improved IE compatibility — IE6+ is now fully supported.
449
450 * Generated parsers are now standalone (no runtime is required).
451
452 * Added example grammars for JavaScript, CSS and JSON.
453
454 * Added a benchmark suite.
455
456 * Implemented negative character classes (e.g. `[^a-z]`).
457
458 * Project moved from BitBucket to GitHub.
459
460 ### Small Changes
461
462 * Code generated for the character classes is now regexp-based (= simpler and
463 more scalable).
464
465 * Added `\uFEFF` (BOM) to the definition of whitespace in the metagrammar.
466
467 * When building a parser, left-recursive rules (both direct and indirect) are
468 reported as errors.
469
470 * When building a parser, missing rules are reported as errors.
471
472 * Expected items in the error messages do not contain duplicates and they are
473 sorted.
474
475 * Fixed several bugs in the example arithmetics grammar.
476
477 * Converted `README` to GitHub Flavored Markdown and improved it.
478
479 * Added `CHANGELOG`.
480
481 * Internal code improvements.
482
483 ## 0.3 (March 14, 2010)
484
485 * Wrote `README`.
486
487 * Bootstrapped the grammar parser.
488
489 * Metagrammar recognizes JavaScript-like comments.
490
491 * Changed standard grammar extension from `.peg` to `.pegjs` (it is more
492 specific).
493
494 * Simplified the example arithmetics grammar + added comment.
495
496 * Fixed a bug with reporting of invalid ranges such as `[b-a]` in the
497 metagrammar.
498
499 * Fixed `--start` vs. `--start-rule` inconsistency between help and actual
500 option processing code.
501
502 * Avoided ugliness in QUnit output.
503
504 * Fixed typo in help: `parserVar` → `parser_var`.
505
506 * Internal code improvements.
507
508 ## 0.2.1 (March 8, 2010)
509
510 * Added `pegjs-` prefix to the name of the minified runtime file.
511
512 ## 0.2 (March 8, 2010)
513
514 * Added `Rakefile` that builds minified runtime using Google Closure Compiler
515 API.
516
517 * Removed trailing commas in object initializers (Google Closure does not like
518 them).
519
520 ## 0.1 (March 8, 2010)
521
522 * Initial release.