rbs 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab99593166ee140ca3ffc517eddcd872c6798dcb41a991c1e67c0c16a2a86fc9
4
- data.tar.gz: a4e5cdd454fb49ddd499ba3382e118f8789b5413d0607ad9e3652551839c0ca3
3
+ metadata.gz: '018869df02515c1d7d1194b7b577e87c2dae8c01dc8fba577252b87bd41cc6d8'
4
+ data.tar.gz: 0c96d33f71b40d62ed5f5e082b0fec5780f6abb63343fcc5b8eb163f9504b8d4
5
5
  SHA512:
6
- metadata.gz: 8d660c0dd7796bad07fac8e2ee85968e91259af0a4c9fed2c8668f0d6e385a517160d5792702181e18923929a3de7ded420c84e2184cb83a852d2133c1f34050
7
- data.tar.gz: 4991d9a71cd0bd2bd2832d7764a8d65a73de146fecf76d3ccd67a41599326ca45b091e559acededcd095a44cdef6e32cc01fbb742e04bba945269b4e21a6444c
6
+ metadata.gz: 3380f6f0558ab9d9052ce6da093c03e3e11a96ebbc29f67d4c88ae4fcad222b980e884527fd741d2a698e77d7fa53f144857eb045b785de20d008a4839b3cc87
7
+ data.tar.gz: 19d98bbcf5ea0ce420ddd0191cdc9042f4b8a7aa329d9bc455205f7c6b5c0300aede0864b7f86f307b10e72c46b9809414997b244ce2564be1e8b3898df81e52
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.3.1 (2021-07-21)
6
+
7
+ This release is to fix a bug introduced by parser update in 1.3.0.
8
+
9
+ * Fix parser to accept param names starting with `_` ([#721](https://github.com/ruby/rbs/pull/721))
10
+
5
11
  ## 1.3.0 (2021-07-20)
6
12
 
7
13
  ### Summary
data/lib/rbs/parser.rb CHANGED
@@ -340,8 +340,8 @@ def next_token
340
340
  new_token(:tLIDENT)
341
341
  when input.scan(/_[a-z]\w*\b/)
342
342
  new_token(:tUNDERSCOREIDENT)
343
- when input.scan(/_/)
344
- new_token(:kUNDERSCORE)
343
+ when input.scan(/_[\w_]*\b/)
344
+ new_token(:tPARAMNAME)
345
345
  when input.scan(/"(\\"|[^"])*"/)
346
346
  s = input.matched.yield_self {|s| s[1, s.length - 2] }
347
347
  .gsub(DBL_QUOTE_STR_ESCAPE_SEQUENCES_RE) do |match|
@@ -1228,7 +1228,7 @@ racc_token_table = {
1228
1228
  :kIN => 79,
1229
1229
  :kUNCHECKED => 80,
1230
1230
  :kOVERLOAD => 81,
1231
- :kUNDERSCORE => 82 }
1231
+ :tPARAMNAME => 82 }
1232
1232
 
1233
1233
  racc_nt_base = 83
1234
1234
 
@@ -1333,7 +1333,7 @@ Racc_token_to_s_table = [
1333
1333
  "kIN",
1334
1334
  "kUNCHECKED",
1335
1335
  "kOVERLOAD",
1336
- "kUNDERSCORE",
1336
+ "tPARAMNAME",
1337
1337
  "$start",
1338
1338
  "target",
1339
1339
  "type",
data/lib/rbs/parser.y CHANGED
@@ -12,7 +12,7 @@ class RBS::Parser
12
12
  kPREPEND kEXTENSION kINCOMPATIBLE
13
13
  type_TYPE type_SIGNATURE type_METHODTYPE tEOF
14
14
  kOUT kIN kUNCHECKED kOVERLOAD
15
- kUNDERSCORE
15
+ tPARAMNAME
16
16
 
17
17
  prechigh
18
18
  nonassoc kQUESTION
@@ -1327,7 +1327,7 @@ rule
1327
1327
  }
1328
1328
 
1329
1329
  var_name_opt:
1330
- | tLIDENT | tINTERFACEIDENT | tQUOTEDIDENT | tUNDERSCOREIDENT | kUNDERSCORE
1330
+ | tLIDENT | tINTERFACEIDENT | tQUOTEDIDENT | tUNDERSCOREIDENT | tPARAMNAME
1331
1331
 
1332
1332
  qualified_name:
1333
1333
  namespace simple_name {
@@ -1722,8 +1722,8 @@ def next_token
1722
1722
  new_token(:tLIDENT)
1723
1723
  when input.scan(/_[a-z]\w*\b/)
1724
1724
  new_token(:tUNDERSCOREIDENT)
1725
- when input.scan(/_/)
1726
- new_token(:kUNDERSCORE)
1725
+ when input.scan(/_[\w_]*\b/)
1726
+ new_token(:tPARAMNAME)
1727
1727
  when input.scan(/"(\\"|[^"])*"/)
1728
1728
  s = input.matched.yield_self {|s| s[1, s.length - 2] }
1729
1729
  .gsub(DBL_QUOTE_STR_ESCAPE_SEQUENCES_RE) do |match|
data/lib/rbs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-20 00:00:00.000000000 Z
11
+ date: 2021-07-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.