parser 3.0.1.1 → 3.1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,21 +35,21 @@ module Parser
35
35
  end
36
36
 
37
37
  def top
38
- @stack.last
38
+ @stack.last[:value]
39
39
  end
40
40
 
41
- def push
42
- @stack.push(0)
41
+ def push(static:)
42
+ @stack.push(value: 0, static: static)
43
43
  end
44
44
 
45
45
  def pop
46
- @stack.pop
46
+ @stack.pop[:value]
47
47
  end
48
48
 
49
49
  private
50
50
 
51
51
  def set(value)
52
- @stack[@stack.length - 1] = value
52
+ @stack.last[:value] = value
53
53
  end
54
54
  end
55
55
 
@@ -76,9 +76,15 @@ module Parser
76
76
  :duplicate_variable_name => 'duplicate variable name %{name}',
77
77
  :duplicate_pattern_key => 'duplicate hash pattern key %{name}',
78
78
  :endless_setter => 'setter method cannot be defined in an endless method definition',
79
+ :invalid_id_to_get => 'identifier %{identifier} is not valid to get',
80
+ :forward_arg_after_restarg => '... after rest argument',
81
+ :no_anonymous_blockarg => 'no anonymous block parameter',
82
+ :no_anonymous_restarg => 'no anonymous rest parameter',
83
+ :no_anonymous_kwrestarg => 'no anonymous keyword rest parameter',
79
84
 
80
85
  # Parser warnings
81
86
  :useless_else => 'else without rescue is useless',
87
+ :duplicate_hash_key => 'key is duplicated and overwritten',
82
88
 
83
89
  # Parser errors that are not Ruby errors
84
90
  :invalid_encoding => 'literal contains escape sequences incompatible with UTF-8',
data/lib/parser/meta.rb CHANGED
@@ -33,6 +33,7 @@ module Parser
33
33
  hash_pattern const_pattern if_guard unless_guard match_nil_pattern
34
34
  empty_else find_pattern kwargs
35
35
  match_pattern_p match_pattern
36
+ forwarded_restarg forwarded_kwrestarg
36
37
  ).to_set.freeze
37
38
 
38
39
  end # Meta