parser 2.2.2.1 → 2.2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 918d40074c3300d2fa2d060cabb74a87dbd20974
4
- data.tar.gz: a9c8f078d218c36abdbfdbea05a45214016c061d
3
+ metadata.gz: e9642fd7259af701acf759e9083a66ca26a0c4de
4
+ data.tar.gz: a689a5f7b816813fb86845abeef9e92f9dbba73b
5
5
  SHA512:
6
- metadata.gz: e4398ec85496d00494993e3a8246eb612b4c0531574cb4e4d5d08e7e5b3afc4bbb4da1c7d76e05714f324c8dd1a49cbc9bc5a0222e97e078421b19dccf4106f2
7
- data.tar.gz: 6fa7af3a14f737508a75eb763dd6975bf2f6dfd51da35b74d1b00f0a0b805c170933cec74f462e9b66bc8ec0b60b802575ac38d75587f7adec578ab6dab3e531
6
+ metadata.gz: a9688dd01f3454ad7adc0c21e23de107529acc73709f49bf12845425db1e65cf75da35ac94d79bbabac731759695a85efbf67d9062a739e43aaf0d031aa0255b
7
+ data.tar.gz: f33b299a27fafb355fa0b44101e22cee7db03407fe16d8acf6c64ce7b0d0901fa042eb7c0a824f17aa8d9ae8b02323a47f90d5489299a4a8f0468f26d2bd411a
@@ -1,12 +1,21 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- v2.2.2.1 (2015-04-17)
4
+ v2.2.2.2 (2015-04-28)
5
+ ---------------------
6
+
7
+ Bugs fixed:
8
+ * lexer.rl: "%r.\..", "%r'\''": leave regexp metacharacters escaped (fixes #192). (whitequark)
9
+
10
+ v2.2.2.1 (2015-04-18)
5
11
  ---------------------
6
12
 
7
13
  Bugs fixed:
8
14
  * builders/default: don't falsely diagnose multiline regexps (fixes #190). (whitequark)
9
15
 
16
+ v2.2.2.0 (2015-04-15)
17
+ ---------------------
18
+
10
19
  v2.2.0.4 (2015-04-15)
11
20
  ---------------------
12
21
 
@@ -14,6 +23,12 @@ Features implemented:
14
23
  * Add Parser::Source::Map#node. (whitequark)
15
24
  * Add Parser::Source::Comment.associate_locations. (kubicle)
16
25
 
26
+ v2.2.0.3 (2015-02-13)
27
+ ---------------------
28
+
29
+ v2.2.0.2 (2015-01-09)
30
+ ---------------------
31
+
17
32
  v2.2.0.1 (2014-12-27)
18
33
  ---------------------
19
34
 
@@ -205,6 +220,9 @@ Bugs fixed:
205
220
  * lexer.rl: "->*{}": tLAMBEG at expr_beg (fixes #103). (Peter Zotov)
206
221
  * Source::Rewriter: apply actions in the insertion order. (Josh Cheek)
207
222
 
223
+ v2.0.0.pre6 (2013-08-02)
224
+ ------------------------
225
+
208
226
  v2.0.0.pre5 (2013-07-31)
209
227
  ------------------------
210
228
 
@@ -290,6 +308,9 @@ Features implemented:
290
308
  Bugs fixed:
291
309
  * Don't treat byte order mark as an identifier (closes #91). (Peter Zotov)
292
310
 
311
+ v2.0.0.pre1 (2013-07-04)
312
+ ------------------------
313
+
293
314
  v2.0.0.beta10 (2013-07-02)
294
315
  --------------------------
295
316
 
@@ -495,6 +516,9 @@ Bugs fixed:
495
516
  * ruby18.y, ruby19.y: BEGIN{} does not introduce a scope. (Peter Zotov)
496
517
  * lexer.rl: improve whitespace handling. (Peter Zotov)
497
518
 
519
+ v0.9.1 (2013-04-15)
520
+ -------------------
521
+
498
522
  v0.9.0 (2013-04-15)
499
523
  -------------------
500
524
 
@@ -1,10 +1,17 @@
1
1
  Contributing to Parser
2
2
  ----------------------
3
3
 
4
- Parser uses [Semantic Versioning](http://semver.org). Additionally, Parser employs a script to extract information from VCS (git) log and form a Changelog file. Thus, each commit which affects the public API in any way must be marked with one of the following sigils, or characters at the beginning of line:
4
+ Parser employs a script to extract information from VCS (git) log and form a Changelog file. Thus, each commit which affects the public API in any way must be marked with one of the following sigils, or characters at the beginning of line:
5
5
 
6
6
  * `-` for bugfixes. For example: `- lexer.rl: fixed lexing of "alias $foo $bar".`
7
7
  * `+` for features. For example: `+ Implemented Parser::Rewriter, a module for non-intrusive rewriting of source code.`
8
8
  * `*` for miscellaneous changes. For example: `* Converted measurement units from metric to imperial.`
9
9
 
10
- These categories map nicely to semantic versioning: `-` bugfixes increment patchlevel, `+` features increment minor version, `*` API changes increment major version.
10
+ Versioning
11
+ ----------
12
+
13
+ Parser is versioned as follows:
14
+ * The version starts with the most recent Ruby version that Parser supports (which should be also the most recent released Ruby version).
15
+ * After that, a `.x` is appended, where `x` is incremented for every change.
16
+
17
+ No breaking changes to API will be ever made, except for changes that correct behavior which did not match documentation or Ruby MRI behavior.
data/Rakefile CHANGED
@@ -90,10 +90,12 @@ task :changelog do
90
90
  date = Date.parse(date)
91
91
 
92
92
  current_version = "#{$1} (#{date})" if version =~ /(v[\d\w.]+)/
93
- current_version = "v#{Parser::VERSION} (#{date})" if version =~ /HEAD/
93
+ current_version = "v#{Parser::VERSION} (#{date})" if version =~ /(^|[^\/])master/
94
94
 
95
- next if current_version.nil? || message !~ /^[+*-]/
95
+ next if current_version.nil?
96
+ changelog[current_version] # add a hash
96
97
 
98
+ next if message !~ /^[+*-]/
97
99
  changelog[current_version][message[0]] << "#{message[1..-1]} (#{author})"
98
100
  end
99
101
  end
@@ -865,9 +865,15 @@ class Parser::Lexer
865
865
  # or closing delimiter, it is an escape sequence for that
866
866
  # particular character. Write it without the backslash.
867
867
 
868
- if literal.regexp? && escaped_char == '\\'
869
- # Regular expressions should include backslashes in their escaped
870
- # form.
868
+ if literal.regexp? && "\\$()*+.<>?[]^{|}".include?(escaped_char)
869
+ # Regular expressions should include escaped delimiters in their
870
+ # escaped form, except when the escaped character is
871
+ # a closing delimiter but not a regexp metacharacter.
872
+ #
873
+ # The backslash itself cannot be used as a closing delimiter
874
+ # at the same time as an escape symbol, but it is always munged,
875
+ # so this branch also executes for the non-closing-delimiter case
876
+ # for the backslash.
871
877
  literal.extend_string(tok, @ts, @te)
872
878
  else
873
879
  literal.extend_string(escaped_char, @ts, @te)
@@ -1,3 +1,3 @@
1
1
  module Parser
2
- VERSION = '2.2.2.1'
2
+ VERSION = '2.2.2.2'
3
3
  end
@@ -1597,7 +1597,7 @@ class TestLexer < Minitest::Test
1597
1597
  def test_regexp_escape_backslash_terminator_meta1
1598
1598
  assert_scanned('%r{blah\\}blah}',
1599
1599
  :tREGEXP_BEG, "%r{",
1600
- :tSTRING_CONTENT, "blah}blah",
1600
+ :tSTRING_CONTENT, "blah\\}blah",
1601
1601
  :tSTRING_END, "}",
1602
1602
  :tREGEXP_OPT, "")
1603
1603
  end
@@ -1714,6 +1714,22 @@ class TestLexer < Minitest::Test
1714
1714
  :tREGEXP_OPT, "")
1715
1715
  end
1716
1716
 
1717
+ def test_regexp_escape_delimiter_meta
1718
+ assert_scanned("%r(\\))",
1719
+ :tREGEXP_BEG, "%r(",
1720
+ :tSTRING_CONTENT, "\\)",
1721
+ :tSTRING_END, ")",
1722
+ :tREGEXP_OPT, "")
1723
+ end
1724
+
1725
+ def test_regexp_escape_delimiter_nonmeta
1726
+ assert_scanned("%r'\\''",
1727
+ :tREGEXP_BEG, "%r'",
1728
+ :tSTRING_CONTENT, "'",
1729
+ :tSTRING_END, "'",
1730
+ :tREGEXP_OPT, "")
1731
+ end
1732
+
1717
1733
  def test_regexp_nm
1718
1734
  assert_scanned("/.*/nm",
1719
1735
  :tREGEXP_BEG, "/",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2.1
4
+ version: 2.2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Zotov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-18 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast