rubocop-ast 1.46.0 → 1.47.1

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
  SHA256:
3
- metadata.gz: 2b94b9545a7aceaf8b52e8e6b8713df63fe1113c4040fd5f92563438c0307d21
4
- data.tar.gz: 6db23c373003f60f0faf0f48ff1a4cb7d086f36820e7f5e732a147eea0d22f98
3
+ metadata.gz: 1bffbd470297f3e2a3ef1db00d3259258c7ced492c848913d5df487c7283b395
4
+ data.tar.gz: 39db744fd59f6a5f326ffa22516194f2b2c0666ebf3d8fc9211caed06aeacfd6
5
5
  SHA512:
6
- metadata.gz: 3a0fb03bcb60b82177efefcf2146d1512c50f9791f094769d64ae7c87899e9984ce41eebdb1fc8f6d8c40b287e42621f6d4bd9fdde23fe9884ebc0dd2202b5ae
7
- data.tar.gz: 8fd5e39ac28109336a207edfedf5fc6b782ede8da4594cfdd1faf41e8e9df4d59a17716e1ea55121c575514d17fce9e0b3071ab98ecc54b007f66af8f002f560
6
+ metadata.gz: 693ddec9b2ab60ded1ab59f4a344d92dab3d72d9c14fdf7ea6222bc1ae5ce58066ed504946095d6b770d3bfb0bdd4cbb0212f51889f2713b347097887b13b63d
7
+ data.tar.gz: c19c8995d2de5c654ae169ac036d501042b808a487aa767ff93bdd3e4f2b5b452e79e80c7f57be92e9957e47a39149fcae5c932feb1dc1e001b1a6a2fce96836
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rubocop-ast.svg)](https://badge.fury.io/rb/rubocop-ast)
4
4
  [![CI](https://github.com/rubocop/rubocop-ast/actions/workflows/rubocop.yml/badge.svg)](https://github.com/rubocop/rubocop-ast/actions/workflows/rubocop.yml)
5
- [![Test Coverage](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/test_coverage)](https://codeclimate.com/github/rubocop/rubocop-ast/test_coverage)
6
- [![Maintainability](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/maintainability)](https://codeclimate.com/github/rubocop/rubocop-ast/maintainability)
7
5
 
8
6
  Contains the classes needed by [RuboCop](https://github.com/rubocop/rubocop) to deal with Ruby's AST, in particular:
9
7
 
@@ -65,6 +65,7 @@ module RuboCop
65
65
  # arguments
66
66
  module WrappedArguments
67
67
  include ParameterizedNode
68
+
68
69
  # @return [Array] The arguments of the node.
69
70
  def arguments
70
71
  first = children.first
@@ -108,6 +108,13 @@ module RuboCop
108
108
  rational: :numeric,
109
109
  complex: :numeric,
110
110
 
111
+ str: :any_str,
112
+ dstr: :any_str,
113
+ xstr: :any_str,
114
+
115
+ sym: :any_sym,
116
+ dsym: :any_sym,
117
+
111
118
  irange: :range,
112
119
  erange: :range,
113
120
 
@@ -547,6 +554,14 @@ module RuboCop
547
554
  GROUP_FOR_TYPE[type] == :any_match_pattern
548
555
  end
549
556
 
557
+ def any_str_type?
558
+ GROUP_FOR_TYPE[type] == :any_str
559
+ end
560
+
561
+ def any_sym_type?
562
+ GROUP_FOR_TYPE[type] == :any_sym
563
+ end
564
+
550
565
  def guard_clause?
551
566
  node = operator_keyword? ? rhs : self
552
567
 
@@ -10,6 +10,7 @@ module RuboCop
10
10
  # /docs/modules/ROOT/pages/node_pattern.adoc
11
11
  class Compiler
12
12
  extend SimpleForwardable
13
+
13
14
  attr_reader :captures, :named_parameters, :positional_parameters, :binding
14
15
 
15
16
  def initialize
@@ -21,7 +21,7 @@ macros
21
21
  rules
22
22
  /\s+/
23
23
  /:(#{SYMBOL_NAME})/o { emit :tSYMBOL, &:to_sym }
24
- /"(.+?)"/ { emit :tSTRING }
24
+ /"(.*?)"/ { emit :tSTRING }
25
25
  /[-+]?\d+\.\d+/ { emit :tNUMBER, &:to_f }
26
26
  /[-+]?\d+/ { emit :tNUMBER, &:to_i }
27
27
  /#{Regexp.union(
@@ -122,7 +122,7 @@ class RuboCop::AST::NodePattern::LexerRex
122
122
  # do nothing
123
123
  when ss.skip(/:(#{SYMBOL_NAME})/o) then
124
124
  action { emit :tSYMBOL, &:to_sym }
125
- when ss.skip(/"(.+?)"/) then
125
+ when ss.skip(/"(.*?)"/) then
126
126
  action { emit :tSTRING }
127
127
  when ss.skip(/[-+]?\d+\.\d+/) then
128
128
  action { emit :tNUMBER, &:to_f }
@@ -50,6 +50,7 @@ module RuboCop
50
50
 
51
51
  extend SimpleForwardable
52
52
  include MethodDefiner
53
+
53
54
  Invalid = Class.new(StandardError)
54
55
 
55
56
  VAR = 'node'
@@ -79,6 +79,7 @@ module RuboCop
79
79
  end
80
80
  private_constant :CallbackCompiler
81
81
  extend CallbackCompiler
82
+
82
83
  send_code = CallbackCompiler::SEND
83
84
 
84
85
  ### children count == 0
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '1.46.0'
6
+ STRING = '1.47.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.46.0
4
+ version: 1.47.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-07-16 00:00:00.000000000 Z
13
+ date: 2025-09-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser