regexp_parser 2.8.0 → 2.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md DELETED
@@ -1,684 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [2.8.0] - 2023-04-17 - [Janosch Müller](mailto:janosch84@gmail.com)
11
-
12
- ### Added
13
-
14
- - `Regexp::Expression::Shared#ends_at`
15
- * e.g. `parse(/a +/x)[0].ends_at # => 3`
16
- * e.g. `parse(/a +/x)[0].ends_at(include_quantifier = false) # => 1`
17
- - `Regexp::Expression::Shared#{capturing?,comment?}`
18
- * previously only available on capturing and comment groups
19
- - `Regexp::Expression::Shared#{decorative?}`
20
- * true for decorations: comment groups as well as comments and whitespace in x-mode
21
- - `Regexp::Expression::Shared#parent`
22
- - new format argument `:original` for `Regexp::Expression::Base#to_s`
23
- * includes decorative elements between node and its quantifier
24
- * e.g. `parse(/a (?#comment) +/x)[0].to_s(:original) # => "a (?#comment) +"`
25
- * using it is not needed when calling `Root#to_s` as Root can't be quantified
26
- - support calling `Subexpression#{each_expression,flat_map}` with a one-argument block
27
- * in this case, only the expressions are passed to the block, no indices
28
- - support calling test methods at Expression class level
29
- - `capturing?`, `comment?`, `decorative?`, `referential?`, `terminal?`
30
- - e.g. `Regexp::Expression::CharacterSet.terminal? # => false`
31
-
32
- ### Fixed
33
-
34
- - `Regexp::Expression::Shared#full_length` with whitespace before quantifier
35
- * e.g. `parse(/a +/x)[0].full_length` used to yield `2`, now it yields `3`
36
- - `Subexpression#to_s` output with children with whitespace before their quantifier
37
- * e.g. `parse(/a + /x).to_s` used to yield `"a+ "`, now it yields `"a + "`
38
- * calling `#to_s` on sub-nodes still omits such decorative interludes by default
39
- - use new `#to_s` format `:original` to include it
40
- - e.g. `parse(/a + /x)[0].to_s(:original) # => "a +"`
41
- - fixed `Subexpression#te` behaving differently from other expressions
42
- * only `Subexpression#te` used to include the quantifier
43
- * now `#te` is the end index without quantifier, as for other expressions
44
- - fixed `NoMethodError` when calling `#starts_at` or `#ts` on empty sequences
45
- * e.g. `Regexp::Parser.parse(/|/)[0].starts_at`
46
- * e.g. `Regexp::Parser.parse(/[&&]/)[0][0].starts_at`
47
- - fixed nested comment groups breaking local x-options
48
- * e.g. in `/(?x:(?#hello)) /`, the x-option wrongly applied to the whitespace
49
- - fixed nested comment groups breaking conditionals
50
- * e.g. in `/(a)(?(1)b|c(?#hello)d)e/`, the 2nd conditional branch included "e"
51
- - fixed quantifiers after comment groups being mis-assigned to that group
52
- * e.g. in `/a(?#foo){3}/` (matches 'aaa')
53
- - fixed Scanner accepting two cases of invalid Regexp syntax
54
- * unmatched closing parentheses (`)`) and k-backrefs with number 0 (`\k<0>`)
55
- * these are a `SyntaxError` in Ruby, so could only be passed as a String
56
- * they now raise a `Regexp::Scanner::ScannerError`
57
- - fixed some scanner errors not inheriting from `Regexp::Scanner::ScannerError`
58
- - reduced verbosity of inspect / pretty print output
59
-
60
- ## [2.7.0] - 2023-02-08 - [Janosch Müller](mailto:janosch84@gmail.com)
61
-
62
- ### Added
63
-
64
- - `Regexp::Lexer.lex` now streams tokens when called with a block
65
- * it can now take arbitrarily large input, just like `Regexp::Scanner`
66
- * this also slightly improves `Regexp::Parser.parse` performance
67
- * note: `Regexp::Parser.parse` still does not and will not support streaming
68
- - improved performance of `Subexpression#each_expression`
69
- - minor improvements to `Regexp::Scanner` performance
70
- - overall improvement of parse performance: about 10% for large Regexps
71
-
72
- ### Fixed
73
-
74
- - parsing of octal escape sequences in sets, e.g. `[\141]`
75
- * thanks to [Randy Stauner](https://github.com/rwstauner) for the report
76
-
77
- ## [2.6.2] - 2023-01-19 - [Janosch Müller](mailto:janosch84@gmail.com)
78
-
79
- ### Fixed
80
-
81
- - fixed `SystemStackError` when cloning recursive subexpression calls
82
- * e.g. `Regexp::Parser.parse(/a|b\g<0>/).dup`
83
-
84
- ## [2.6.1] - 2022-11-16 - [Janosch Müller](mailto:janosch84@gmail.com)
85
-
86
- ### Fixed
87
-
88
- - fixed scanning of two negative lookbehind edge cases
89
- * `(?<!x)y>` used to raise a ScannerError
90
- * `(?<!x>)y` used to be misinterpreted as a named group
91
- * thanks to [Sergio Medina](https://github.com/serch) for the report
92
-
93
- ## [2.6.0] - 2022-09-26 - [Janosch Müller](mailto:janosch84@gmail.com)
94
-
95
- ### Fixed
96
-
97
- - fixed `#referenced_expression` for `\g<0>` (was `nil`, is now the `Root` exp)
98
- - fixed `#reference`, `#referenced_expression` for recursion level backrefs
99
- * e.g. `(a)(b)\k<-1+1>`
100
- * `#referenced_expression` was `nil`, now it is the correct `Group` exp
101
- - detect and raise for two more syntax errors when parsing String input
102
- * quantification of option switches (e.g. `(?i)+`)
103
- * invalid references (e.g. `/\k<1>/`)
104
- * these are a `SyntaxError` in Ruby, so could only be passed as a String
105
-
106
- ### Added
107
-
108
- - `Regexp::Expression::Base#human_name`
109
- * returns a nice, human-readable description of the expression
110
- - `Regexp::Expression::Base#optional?`
111
- * returns `true` if the expression is quantified accordingly (e.g. with `*`, `{,n}`)
112
- - added a deprecation warning when calling `#to_re` on set members
113
-
114
- ## [2.5.0] - 2022-05-27 - [Janosch Müller](mailto:janosch84@gmail.com)
115
-
116
- ### Added
117
-
118
- - `Regexp::Expression::Base.construct` and `.token_class` methods
119
- * see the [wiki](https://github.com/ammar/regexp_parser/wiki) for details
120
-
121
- ## [2.4.0] - 2022-05-09 - [Janosch Müller](mailto:janosch84@gmail.com)
122
-
123
- ### Fixed
124
-
125
- - fixed interpretation of `+` and `?` after interval quantifiers (`{n,n}`)
126
- * they used to be treated as reluctant or possessive mode indicators
127
- * however, Ruby does not support these modes for interval quantifiers
128
- * they are now treated as chained quantifiers instead, as Ruby does it
129
- * c.f. [#3](https://github.com/ammar/regexp_parser/issues/3)
130
- - fixed `Expression::Base#nesting_level` for some tree rewrite cases
131
- * e.g. the alternatives in `/a|[b]/` had an inconsistent nesting_level
132
- - fixed `Scanner` accepting invalid posix classes, e.g. `[[:foo:]]`
133
- * they raise a `SyntaxError` when used in a Regexp, so could only be passed as String
134
- * they now raise a `Regexp::Scanner::ValidationError` in the `Scanner`
135
-
136
- ### Added
137
-
138
- - added `Expression::Base#==` for (deep) comparison of expressions
139
- - added `Expression::Base#parts`
140
- * returns the text elements and subexpressions of an expression
141
- * e.g. `parse(/(a)/)[0].parts # => ["(", #<Literal @text="a"...>, ")"]`
142
- - added `Expression::Base#te` (a.k.a. token end index)
143
- * `Expression::Subexpression` always had `#te`, only terminal nodes lacked it so far
144
- - made some `Expression::Base` methods available on `Quantifier` instances, too
145
- * `#type`, `#type?`, `#is?`, `#one_of?`, `#options`, `#terminal?`
146
- * `#base_length`, `#full_length`, `#starts_at`, `#te`, `#ts`, `#offset`
147
- * `#conditional_level`, `#level`, `#nesting_level` , `#set_level`
148
- * this allows a more unified handling with `Expression::Base` instances
149
- - allowed `Quantifier#initialize` to take a token and options Hash like other nodes
150
- - added a deprecation warning for initializing Quantifiers with 4+ arguments:
151
-
152
- Calling `Expression::Base#quantify` or `Quantifier.new` with 4+ arguments
153
- is deprecated.
154
-
155
- It will no longer be supported in regexp_parser v3.0.0.
156
-
157
- Please pass a Regexp::Token instead, e.g. replace `token, text, min, max, mode`
158
- with `::Regexp::Token.new(:quantifier, token, text)`. min, max, and mode
159
- will be derived automatically.
160
-
161
- Or do `exp.quantifier = Quantifier.construct(token: token, text: str)`.
162
-
163
- This is consistent with how Expression::Base instances are created.
164
-
165
-
166
- ## [2.3.1] - 2022-04-24 - [Janosch Müller](mailto:janosch84@gmail.com)
167
-
168
- ### Fixed
169
-
170
- - removed five inexistent unicode properties from `Syntax#features`
171
- * these were never supported by Ruby or the `Regexp::Scanner`
172
- * thanks to [Markus Schirp](https://github.com/mbj) for the report
173
-
174
- ## [2.3.0] - 2022-04-08 - [Janosch Müller](mailto:janosch84@gmail.com)
175
-
176
- ### Added
177
-
178
- - improved parsing performance through `Syntax` refactoring
179
- * instead of fresh `Syntax` instances, pre-loaded constants are now re-used
180
- * this approximately doubles the parsing speed for simple regexps
181
- - added methods to `Syntax` classes to show relative feature sets
182
- * e.g. `Regexp::Syntax::V3_2_0.added_features`
183
- - support for new unicode properties of Ruby 3.2 / Unicode 14.0
184
-
185
- ## [2.2.1] - 2022-02-11 - [Janosch Müller](mailto:janosch84@gmail.com)
186
-
187
- ### Fixed
188
-
189
- - fixed Syntax version of absence groups (`(?~...)`)
190
- * the lexer accepted them for any Ruby version
191
- * now they are only recognized for Ruby >= 2.4.1 in which they were introduced
192
- - reduced gem size by excluding specs from package
193
- - removed deprecated `test_files` gemspec setting
194
- - no longer depend on `yaml`/`psych` (except for Ruby <= 2.4)
195
- - no longer depend on `set`
196
- * `set` was removed from the stdlib and made a standalone gem as of Ruby 3
197
- * this made it a hidden/undeclared dependency of `regexp_parser`
198
-
199
- ## [2.2.0] - 2021-12-04 - [Janosch Müller](mailto:janosch84@gmail.com)
200
-
201
- ### Added
202
-
203
- - added support for 13 new unicode properties introduced in Ruby 3.1.0
204
-
205
- ## [2.1.1] - 2021-02-23 - [Janosch Müller](mailto:janosch84@gmail.com)
206
-
207
- ### Fixed
208
-
209
- - fixed `NameError` when requiring only `'regexp_parser/scanner'` in v2.1.0
210
- * thanks to [Jared White and Sam Ruby](https://github.com/ruby2js/ruby2js) for the report
211
-
212
- ## [2.1.0] - 2021-02-22 - [Janosch Müller](mailto:janosch84@gmail.com)
213
-
214
- ### Added
215
-
216
- - common ancestor for all scanning/parsing/lexing errors
217
- * `Regexp::Parser::Error` can now be rescued as a catch-all
218
- * the following errors (and their many descendants) now inherit from it:
219
- - `Regexp::Expression::Conditional::TooManyBranches`
220
- - `Regexp::Parser::ParserError`
221
- - `Regexp::Scanner::ScannerError`
222
- - `Regexp::Scanner::ValidationError`
223
- - `Regexp::Syntax::SyntaxError`
224
- * it replaces `ArgumentError` in some rare cases (`Regexp::Parser.parse('?')`)
225
- * thanks to [sandstrom](https://github.com/sandstrom) for the cue
226
-
227
- ### Fixed
228
-
229
- - fixed scanning of whole-pattern recursion calls `\g<0>` and `\g'0'`
230
- * a regression in v2.0.1 had caused them to be scanned as literals
231
- - fixed scanning of some backreference and subexpression call edge cases
232
- * e.g. `\k<+1>`, `\g<x-1>`
233
- - fixed tokenization of some escapes in character sets
234
- * `.`, `|`, `{`, `}`, `(`, `)`, `^`, `$`, `?`, `+`, `*`
235
- * all of these correctly emitted `#type` `:literal` and `#token` `:literal` if *not* escaped
236
- * if escaped, they emitted e.g. `#type` `:escape` and `#token` `:group_open` for `[\(]`
237
- * the escaped versions now correctly emit `#type` `:escape` and `#token` `:literal`
238
- - fixed handling of control/metacontrol escapes in character sets
239
- * e.g. `[\cX]`, `[\M-\C-X]`
240
- * they were misread as bunch of individual literals, escapes, and ranges
241
- - fixed some cases where calling `#dup`/`#clone` on expressions led to shared state
242
-
243
- ## [2.0.3] - 2020-12-28 - [Janosch Müller](mailto:janosch84@gmail.com)
244
-
245
- ### Fixed
246
-
247
- - fixed error when scanning some unlikely and redundant but valid charset patterns
248
- * e.g. `/[[.a-b.]]/`, `/[[=e=]]/`,
249
- - fixed ancestry of some error classes related to syntax version lookup
250
- * `NotImplementedError`, `InvalidVersionNameError`, `UnknownSyntaxNameError`
251
- * they now correctly inherit from `Regexp::Syntax::SyntaxError` instead of Rubys `::SyntaxError`
252
-
253
- ## [2.0.2] - 2020-12-25 - [Janosch Müller](mailto:janosch84@gmail.com)
254
-
255
- ### Fixed
256
-
257
- - fixed `FrozenError` when calling `#to_s` on a frozen `Group::Passive`
258
- * thanks to [Daniel Gollahon](https://github.com/dgollahon)
259
-
260
- ## [2.0.1] - 2020-12-20 - [Janosch Müller](mailto:janosch84@gmail.com)
261
-
262
- ### Fixed
263
-
264
- - fixed error when scanning some group names
265
- * this affected names containing hyphens, digits or multibyte chars, e.g. `/(?<a1>a)/`
266
- * thanks to [Daniel Gollahon](https://github.com/dgollahon) for the report
267
- - fixed error when scanning hex escapes with just one hex digit
268
- * e.g. `/\x0A/` was scanned correctly, but the equivalent `/\xA/` was not
269
- * thanks to [Daniel Gollahon](https://github.com/dgollahon) for the report
270
-
271
- ## [2.0.0] - 2020-11-25 - [Janosch Müller](mailto:janosch84@gmail.com)
272
-
273
- ### Changed
274
-
275
- - some methods that used to return byte-based indices now return char-based indices
276
- * the returned values have only changed for Regexps that contain multibyte chars
277
- * this is only a breaking change if you used such methods directly AND relied on them pointing to bytes
278
- * affected methods:
279
- * `Regexp::Token` `#length`, `#offset`, `#te`, `#ts`
280
- * `Regexp::Expression::Base` `#full_length`, `#offset`, `#starts_at`, `#te`, `#ts`
281
- * thanks to [Akinori MUSHA](https://github.com/knu) for the report
282
- - removed some deprecated methods/signatures
283
- * these are rarely used and have been showing deprecation warnings for a long time
284
- * `Regexp::Expression::Subexpression.new` with 3 arguments
285
- * `Regexp::Expression::Root.new` without a token argument
286
- * `Regexp::Expression.parsed`
287
-
288
- ### Added
289
-
290
- - `Regexp::Expression::Base#base_length`
291
- * returns the character count of an expression body, ignoring any quantifier
292
- - pragmatic, experimental support for chained quantifiers
293
- * e.g.: `/^a{10}{4,6}$/` matches exactly 40, 50 or 60 `a`s
294
- * successive quantifiers used to be silently dropped by the parser
295
- * they are now wrapped with passive groups as if they were written `(?:a{10}){4,6}`
296
- * thanks to [calfeld](https://github.com/calfeld) for reporting this a while back
297
-
298
- ### Fixed
299
-
300
- - incorrect encoding output for non-ascii comments
301
- * this led to a crash when calling `#to_s` on parse results containing such comments
302
- * thanks to [Michael Glass](https://github.com/michaelglass) for the report
303
- - some crashes when scanning contrived patterns such as `'\😋'`
304
-
305
- ### [1.8.2] - 2020-10-11 - [Janosch Müller](mailto:janosch84@gmail.com)
306
-
307
- ### Fixed
308
-
309
- - fix `FrozenError` in `Expression::Base#repetitions` on Ruby 3.0
310
- * thanks to [Thomas Walpole](https://github.com/twalpole)
311
- - removed "unknown future version" warning on Ruby 3.0
312
-
313
- ### [1.8.1] - 2020-09-28 - [Janosch Müller](mailto:janosch84@gmail.com)
314
-
315
- ### Fixed
316
-
317
- - fixed scanning of comment-like text in normal mode
318
- * this was an old bug, but had become more prevalent in v1.8.0
319
- * thanks to [Tietew](https://github.com/Tietew) for the report
320
- - specified correct minimum Ruby version in gemspec
321
- * it said 1.9 but really required 2.0 as of v1.8.0
322
-
323
- ### [1.8.0] - 2020-09-20 - [Janosch Müller](mailto:janosch84@gmail.com)
324
-
325
- ### Changed
326
-
327
- - dropped support for running on Ruby 1.9.x
328
-
329
- ### Added
330
-
331
- - regexp flags can now be passed when parsing a `String` as regexp body
332
- * see the [README](/README.md#usage) for details
333
- * thanks to [Owen Stephens](https://github.com/owst)
334
- - bare occurrences of `\g` and `\k` are now allowed and scanned as literal escapes
335
- * matches Onigmo behavior
336
- * thanks for the report to [Marc-André Lafortune](https://github.com/marcandre)
337
-
338
- ### Fixed
339
-
340
- - fixed parsing comments without preceding space or trailing newline in x-mode
341
- * thanks to [Owen Stephens](https://github.com/owst)
342
-
343
- ### [1.7.1] - 2020-06-07 - [Ammar Ali](mailto:ammarabuali@gmail.com)
344
-
345
- ### Fixed
346
-
347
- - Support for literals that include the unescaped delimiters `{`, `}`, and `]`. These
348
- delimiters are informally supported by various regexp engines.
349
-
350
- ### [1.7.0] - 2020-02-23 - [Janosch Müller](mailto:janosch84@gmail.com)
351
-
352
- ### Added
353
-
354
- - `Expression::Base#each_expression` and `#traverse` can now be called without a block
355
- * this returns an `Enumerator` and allows chaining, e.g. `each_expression.select`
356
- * thanks to [Masataka Kuwabara](https://github.com/pocke)
357
-
358
- ### Fixed
359
-
360
- - `MatchLength#each` no longer ignores the given `limit:` when called without a block
361
-
362
- ### [1.6.0] - 2019-06-16 - [Janosch Müller](mailto:janosch84@gmail.com)
363
-
364
- ### Added
365
-
366
- - Added support for 16 new unicode properties introduced in Ruby 2.6.2 and 2.6.3
367
-
368
- ### [1.5.1] - 2019-05-23 - [Janosch Müller](mailto:janosch84@gmail.com)
369
-
370
- ### Fixed
371
-
372
- - Fixed `#options` (and thus `#i?`, `#u?` etc.) not being set for some expressions:
373
- * this affected posix classes as well as alternation, conditional, and intersection branches
374
- * `#options` was already correct for all child expressions of such branches
375
- * this only made an operational difference for posix classes as they respect encoding flags
376
- - Fixed `#options` not respecting all negative options in weird cases like '(?u-m-x)'
377
- - Fixed `Group#option_changes` not accounting for indirectly disabled (overridden) encoding flags
378
- - Fixed `Scanner` allowing negative encoding options if there were no positive options, e.g. '(?-u)'
379
- - Fixed `ScannerError` for some valid meta/control sequences such as '\\C-\\\\'
380
- - Fixed `Expression::Base#match` and `#=~` not working with a single argument
381
-
382
- ### [1.5.0] - 2019-05-14 - [Janosch Müller](mailto:janosch84@gmail.com)
383
-
384
- ### Added
385
-
386
- - Added `#referenced_expression` for backrefs, subexp calls and conditionals
387
- * returns the `Group` expression that is being referenced via name or number
388
- - Added `Expression::Base#repetitions`
389
- * returns a `Range` of allowed repetitions (`1..1` if there is no quantifier)
390
- * like `#quantity` but with a more uniform interface
391
- - Added `Expression::Base#match_length`
392
- * allows to inspect and iterate over String lengths matched by the Expression
393
-
394
- ### Fixed
395
-
396
- - Fixed `Expression::Base#clone` "direction"
397
- * it used to dup ivars onto the callee, leaving only the clone referencing the original objects
398
- * this will affect you if you call `#eql?`/`#equal?` on expressions or use them as Hash keys
399
- - Fixed `#clone` results for `Sequences`, e.g. alternations and conditionals
400
- * the inner `#text` was cloned onto the `Sequence` and thus duplicated
401
- * e.g. `Regexp::Parser.parse(/(a|bc)/).clone.to_s # => (aa|bcbc)`
402
- - Fixed inconsistent `#to_s` output for `Sequences`
403
- * it used to return only the "specific" text, e.g. "|" for an alternation
404
- * now it includes nested expressions as it does for all other `Subexpressions`
405
- - Fixed quantification of codepoint lists with more than one entry (`\u{62 63 64}+`)
406
- * quantifiers apply only to the last entry, so this token is now split up if quantified
407
-
408
- ### [1.4.0] - 2019-04-02 - [Janosch Müller](mailto:janosch84@gmail.com)
409
-
410
- ### Added
411
-
412
- - Added support for 19 new unicode properties introduced in Ruby 2.6.0
413
-
414
- ### [1.3.0] - 2018-11-14 - [Janosch Müller](mailto:janosch84@gmail.com)
415
-
416
- ### Added
417
-
418
- - `Syntax#features` returns a `Hash` of all types and tokens supported by a given `Syntax`
419
-
420
- ### Fixed
421
-
422
- - Thanks to [Akira Matsuda](https://github.com/amatsuda)
423
- * eliminated warning "assigned but unused variable - testEof"
424
-
425
- ## [1.2.0] - 2018-09-28 - [Janosch Müller](mailto:janosch84@gmail.com)
426
-
427
- ### Added
428
-
429
- - `Subexpression` (branch node) includes `Enumerable`, allowing to `#select` children etc.
430
-
431
- ### Fixed
432
-
433
- - Fixed missing quantifier in `Conditional::Expression` methods `#to_s`, `#to_re`
434
- - `Conditional::Condition` no longer lives outside the recursive `#expressions` tree
435
- * it used to be the only expression stored in a custom ivar, complicating traversal
436
- * its setter and getter (`#condition=`, `#condition`) still work as before
437
-
438
- ## [1.1.0] - 2018-09-17 - [Janosch Müller](mailto:janosch84@gmail.com)
439
-
440
- ### Added
441
-
442
- - Added `Quantifier` methods `#greedy?`, `#possessive?`, `#reluctant?`/`#lazy?`
443
- - Added `Group::Options#option_changes`
444
- * shows the options enabled or disabled by the given options group
445
- * as with all other expressions, `#options` shows the overall active options
446
- - Added `Conditional#reference` and `Condition#reference`, indicating the determinative group
447
- - Added `Subexpression#dig`, acts like [`Array#dig`](http://ruby-doc.org/core-2.5.0/Array.html#method-i-dig)
448
-
449
- ### Fixed
450
-
451
- - Fixed parsing of quantified conditional expressions (quantifiers were assigned to the wrong expression)
452
- - Fixed scanning and parsing of forward-referring subexpression calls (e.g. `\g<+1>`)
453
- - `Root` and `Sequence` expressions now support the same constructor signature as all other expressions
454
-
455
- ## [1.0.0] - 2018-09-01 - [Janosch Müller](mailto:janosch84@gmail.com)
456
-
457
- This release includes several breaking changes, mostly to character sets, #map and properties.
458
-
459
- ### Changed
460
-
461
- - Changed handling of sets (a.k.a. character classes or "bracket expressions")
462
- * see PR [#55](https://github.com/ammar/regexp_parser/pull/55) / issue [#47](https://github.com/ammar/regexp_parser/issues/47) for details
463
- * sets are now parsed to expression trees like other nestable expressions
464
- * `#scan` now emits the same tokens as outside sets (no longer `:set, :member`)
465
- * `CharacterSet#members` has been removed
466
- * new `Range` and `Intersection` classes represent corresponding syntax features
467
- * a new `PosixClass` expression class represents e.g. `[[:ascii:]]`
468
- * `PosixClass` instances behave like `Property` ones, e.g. support `#negative?`
469
- * `#scan` emits `:(non)posixclass, :<type>` instead of `:set, :char_(non)<type>`
470
- - Changed `Subexpression#map` to act like regular `Enumerable#map`
471
- * the old behavior is available as `Subexpression#flat_map`
472
- * e.g. `parse(/[a]/).map(&:to_s) == ["[a]"]`; used to be `["[a]", "a"]`
473
- - Changed expression emissions for some escape sequences
474
- * `EscapeSequence::Codepoint`, `CodepointList`, `Hex` and `Octal` are now all used
475
- * they already existed, but were all parsed as `EscapeSequence::Literal`
476
- * e.g. `\x97` is now `EscapeSequence::Hex` instead of `EscapeSequence::Literal`
477
- - Changed naming of many property tokens (emitted for `\p{...}`)
478
- * if you work with these tokens, see PR [#56](https://github.com/ammar/regexp_parser/pull/56) for details
479
- * e.g. `:punct_dash` is now `:dash_punctuation`
480
- - Changed `(?m)` and the likes to emit as `:options_switch` token (@4ade4d1)
481
- * allows differentiating from group-local `:options`, e.g. `(?m:.)`
482
- - Changed name of `Backreference::..NestLevel` to `..RecursionLevel` (@4184339)
483
- - Changed `Backreference::Number#number` from `String` to `Integer` (@40a2231)
484
-
485
- ### Added
486
-
487
- - Added support for all previously missing properties (about 250)
488
- - Added `Expression::UnicodeProperty#shortcut` (e.g. returns "m" for `\p{mark}`)
489
- - Added `#char(s)` and `#codepoint(s)` methods to all `EscapeSequence` expressions
490
- - Added `#number`/`#name`/`#recursion_level` to all backref/call expressions (@174bf21)
491
- - Added `#number` and `#number_at_level` to capturing group expressions (@40a2231)
492
-
493
- ### Fixed
494
-
495
- - Fixed Ruby version mapping of some properties
496
- - Fixed scanning of some property spellings, e.g. with dashes
497
- - Fixed some incorrect property alias normalizations
498
- - Fixed scanning of codepoint escapes with 6 digits (e.g. `\u{10FFFF}`)
499
- - Fixed scanning of `\R` and `\X` within sets; they act as literals there
500
-
501
- ## [0.5.0] - 2018-04-29 - [Janosch Müller](mailto:janosch84@gmail.com)
502
-
503
- ### Changed
504
-
505
- - Changed handling of Ruby versions (PR [#53](https://github.com/ammar/regexp_parser/pull/53))
506
- * New Ruby versions are now supported by default
507
- * Some deep-lying APIs have changed, which should not affect most users:
508
- * `Regexp::Syntax::VERSIONS` is gone
509
- * Syntax version names have changed from `Regexp::Syntax::Ruby::Vnnn`
510
- to `Regexp::Syntax::Vn_n_n`
511
- * Syntax version classes for Ruby versions without regex feature changes
512
- are no longer predefined and are now only created on demand / lazily
513
- * `Regexp::Syntax::supported?` returns true for any argument >= 1.8.6
514
-
515
- ### Fixed
516
-
517
- - Fixed some use cases of Expression methods #strfregexp and #to_h (@e738107)
518
-
519
- ### Added
520
-
521
- - Added full signature support to collection methods of Expressions (@aa7c55a)
522
-
523
- ## [0.4.13] - 2018-04-04 - [Ammar Ali](mailto:ammarabuali@gmail.com)
524
-
525
- - Added ruby version files for 2.2.10 and 2.3.7
526
-
527
- ## [0.4.12] - 2018-03-30 - [Janosch Müller](mailto:janosch84@gmail.com)
528
-
529
- - Added ruby version files for 2.4.4 and 2.5.1
530
-
531
- ## [0.4.11] - 2018-03-04 - [Janosch Müller](mailto:janosch84@gmail.com)
532
-
533
- - Fixed UnknownSyntaxNameError introduced in v0.4.10 if
534
- the gems parent dir tree included a 'ruby' dir
535
-
536
- ## [0.4.10] - 2018-03-04 - [Janosch Müller](mailto:janosch84@gmail.com)
537
-
538
- - Added ruby version file for 2.6.0
539
- - Added support for Emoji properties (available in Ruby since 2.5.0)
540
- - Added support for XPosixPunct and Regional_Indicator properties
541
- - Fixed parsing of Unicode 6.0 and 7.0 script properties
542
- - Fixed parsing of the special Assigned property
543
- - Fixed scanning of InCyrillic_Supplement property
544
-
545
- ## [0.4.9] - 2017-12-25 - [Ammar Ali](mailto:ammarabuali@gmail.com)
546
-
547
- - Added ruby version file for 2.5.0
548
-
549
- ## [0.4.8] - 2017-12-18 - [Janosch Müller](mailto:janosch84@gmail.com)
550
-
551
- - Added ruby version files for 2.2.9, 2.3.6, and 2.4.3
552
-
553
- ## [0.4.7] - 2017-10-15 - [Janosch Müller](mailto:janosch84@gmail.com)
554
-
555
- - Fixed a thread safety issue (issue #45)
556
- - Some public class methods that were only reliable for
557
- internal use are now private instance methods (PR #46)
558
- - Improved the usefulness of Expression::Base#options (issue #43) -
559
- #options and derived methods such as #i?, #m? and #x? are now
560
- defined for all Expressions that are affected by such flags.
561
- - Fixed scanning of whitespace following (?x) (commit 5c94bd2)
562
- - Fixed a Parser bug where the #number attribute of traditional
563
- numerical backreferences was not set correctly (commit 851b620)
564
-
565
- ## [0.4.6] - 2017-09-18 - [Janosch Müller](mailto:janosch84@gmail.com)
566
-
567
- - Added Parser support for hex escapes in sets (PR #36)
568
- - Added Parser support for octal escapes (PR #37)
569
- - Added support for cluster types \R and \X (PR #38)
570
- - Added support for more metacontrol notations (PR #39)
571
-
572
- ## [0.4.5] - 2017-09-17 - [Ammar Ali](mailto:ammarabuali@gmail.com)
573
-
574
- - Thanks to [Janosch Müller](https://github.com/janosch-x):
575
- * Support ruby 2.2.7 (PR #42)
576
- - Added ruby version files for 2.2.8, 2.3.5, and 2.4.2
577
-
578
- ## [0.4.4] - 2017-07-10 - [Ammar Ali](mailto:ammarabuali@gmail.com)
579
-
580
- - Thanks to [Janosch Müller](https://github.com/janosch-x):
581
- * Add support for new absence operator (PR #33)
582
- - Thanks to [Bartek Bułat](https://github.com/barthez):
583
- * Add support for Ruby 2.3.4 version (PR #40)
584
-
585
- ## [0.4.3] - 2017-03-24 - [Ammar Ali](mailto:ammarabuali@gmail.com)
586
-
587
- - Added ruby version file for 2.4.1
588
-
589
- ## [0.4.2] - 2017-01-10 - [Ammar Ali](mailto:ammarabuali@gmail.com)
590
-
591
- - Thanks to [Janosch Müller](https://github.com/janosch-x):
592
- * Support ruby 2.4 (PR #30)
593
- * Improve codepoint handling (PR #27)
594
-
595
- ## [0.4.1] - 2016-11-22 - [Ammar Ali](mailto:ammarabuali@gmail.com)
596
-
597
- - Updated ruby version file for 2.3.3
598
-
599
- ## [0.4.0] - 2016-11-20 - [Ammar Ali](mailto:ammarabuali@gmail.com)
600
-
601
- - Added Syntax.supported? method
602
- - Updated ruby versions for latest releases; 2.1.10, 2.2.6, and 2.3.2
603
-
604
- ## [0.3.6] - 2016-06-08 - [Ammar Ali](mailto:ammarabuali@gmail.com)
605
-
606
- - Thanks to [John Backus](https://github.com/backus):
607
- * Remove warnings (PR #26)
608
-
609
- ## [0.3.5] - 2016-05-30 - [Ammar Ali](mailto:ammarabuali@gmail.com)
610
-
611
- - Thanks to [John Backus](https://github.com/backus):
612
- * Fix parsing of /\xFF/n (hex:escape) (PR #24)
613
-
614
- ## [0.3.4] - 2016-05-25 - [Ammar Ali](mailto:ammarabuali@gmail.com)
615
-
616
- - Thanks to [John Backus](https://github.com/backus):
617
- * Fix warnings (PR #19)
618
- - Thanks to [Dana Scheider](https://github.com/danascheider):
619
- * Correct error in README (PR #20)
620
- - Fixed mistyped \h and \H character types (issue #21)
621
- - Added ancestry syntax files for latest rubies (issue #22)
622
-
623
- ## [0.3.3] - 2016-04-26 - [Ammar Ali](mailto:ammarabuali@gmail.com)
624
-
625
- - Thanks to [John Backus](https://github.com/backus):
626
- * Fixed scanning of zero length comments (PR #12)
627
- * Fixed missing escape:codepoint_list syntax token (PR #14)
628
- * Fixed to_s for modified interval quantifiers (PR #17)
629
-
630
- ## [0.3.2] - 2016-01-01 - [Ammar Ali](mailto:ammarabuali@gmail.com)
631
-
632
- - Updated ruby versions for latest releases; 2.1.8, 2.2.4, and 2.3.0
633
- - Fixed class name for UnknownSyntaxNameError exception
634
- - Added UnicodeBlocks support to the parser.
635
- - Added UnicodeBlocks support to the scanner.
636
- - Added expand_members method to CharacterSet, returns traditional
637
- or unicode property forms of shothands (\d, \W, \s, etc.)
638
- - Improved meaning and output of %t and %T in strfregexp.
639
- - Added syntax versions for ruby 2.1.4 and 2.1.5 and updated
640
- latest 2.1 version.
641
- - Added to_h methods to Expression, Subexpression, and Quantifier.
642
- - Added traversal methods; traverse, each_expression, and map.
643
- - Added token/type test methods; type?, is?, and one_of?
644
- - Added printing method strfregexp, inspired by strftime.
645
- - Added scanning and parsing of free spacing (x mode) expressions.
646
- - Improved handling of inline options (?mixdau:...)
647
- - Added conditional expressions. Ruby 2.0.
648
- - Added keep (\K) markers. Ruby 2.0.
649
- - Added d, a, and u options. Ruby 2.0.
650
- - Added missing meta sequences to the parser. They were supported by the scanner only.
651
- - Renamed Lexer's method to lex, added an alias to the old name (scan)
652
- - Use #map instead of #each to run the block in Lexer.lex.
653
- - Replaced VERSION.yml file with a constant.
654
- - Update tokens and scanner with new additions in Unicode 7.0.
655
-
656
- ## [0.1.6] - 2014-10-06 - [Ammar Ali](mailto:ammarabuali@gmail.com)
657
-
658
- - Fixed test and gem building rake tasks and extracted the gem
659
- specification from the Rakefile into a .gemspec file.
660
- - Added syntax files for missing ruby 2.x versions. These do not add
661
- extra syntax support, they just make the gem work with the newer
662
- ruby versions.
663
- - Fixed a parser bug where an alternation sequence that contained nested expressions was incorrectly being appended to the parent expression when the nesting was exited. e.g. in /a|(b)c/, c was appended to the root.
664
- - Fixed a bug where character types were not being correctly scanned within character sets. e.g. in [\d], two tokens were scanned; one for the backslash '\' and one for the 'd'
665
-
666
- ## [0.1.5] - 2014-01-14 - [Ammar Ali](mailto:ammarabuali@gmail.com)
667
-
668
- - Added syntax stubs for ruby versions 2.0 and 2.1
669
- - Added clone methods for deep copying expressions.
670
- - Added optional format argument for to_s on expressions to return the text of the expression with (:full, the default) or without (:base) its quantifier.
671
- - Renamed the :beginning_of_line and :end_of_line tokens to :bol and :eol.
672
- - Fixed a bug where alternations with more than two alternatives and one of them ending in a group were being incorrectly nested.
673
- - Improved EOF handling in general and especially from sequences like hex and control escapes.
674
- - Fixed a bug where named groups with an empty name would return a blank token [].
675
- - Fixed a bug where member of a parent set where being added to its last subset.
676
- - Fixed a few mutable string bugs by calling dup on the originals.
677
- - Made ruby 1.8.6 the base for all 1.8 syntax, and the 1.8 name a pointer to the latest (1.8.7 at this time)
678
- - Removed look-behind assertions (positive and negative) from 1.8 syntax
679
- - Added control (\cc and \C-c) and meta (\M-c) escapes to 1.8 syntax
680
- - The default syntax is now the one of the running ruby version in both the lexer and the parser.
681
-
682
- ## [0.1.0] - 2010-11-21 - [Ammar Ali](mailto:ammarabuali@gmail.com)
683
-
684
- - Initial release