lrama 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yaml +5 -1
- data/Gemfile +2 -2
- data/NEWS.md +65 -30
- data/Steepfile +3 -0
- data/doc/development/compressed_state_table/main.md +635 -0
- data/doc/development/compressed_state_table/parse.output +174 -0
- data/doc/development/compressed_state_table/parse.y +22 -0
- data/doc/development/compressed_state_table/parser.rb +282 -0
- data/lib/lrama/bitmap.rb +1 -1
- data/lib/lrama/context.rb +3 -3
- data/lib/lrama/counterexamples/derivation.rb +6 -5
- data/lib/lrama/counterexamples/example.rb +7 -4
- data/lib/lrama/counterexamples/path.rb +4 -0
- data/lib/lrama/counterexamples.rb +19 -9
- data/lib/lrama/grammar/parameterizing_rule/rhs.rb +1 -1
- data/lib/lrama/grammar/rule_builder.rb +1 -1
- data/lib/lrama/grammar/symbols/resolver.rb +4 -0
- data/lib/lrama/grammar.rb +2 -2
- data/lib/lrama/lexer/token/user_code.rb +1 -1
- data/lib/lrama/lexer.rb +1 -0
- data/lib/lrama/parser.rb +520 -487
- data/lib/lrama/state/reduce.rb +2 -3
- data/lib/lrama/version.rb +1 -1
- data/parser.y +38 -27
- data/rbs_collection.lock.yaml +10 -2
- data/sig/lrama/counterexamples/derivation.rbs +33 -0
- data/sig/lrama/counterexamples/example.rbs +45 -0
- data/sig/lrama/counterexamples/path.rbs +21 -0
- data/sig/lrama/counterexamples/production_path.rbs +11 -0
- data/sig/lrama/counterexamples/start_path.rbs +13 -0
- data/sig/lrama/counterexamples/state_item.rbs +10 -0
- data/sig/lrama/counterexamples/transition_path.rbs +11 -0
- data/sig/lrama/counterexamples/triple.rbs +20 -0
- data/sig/lrama/counterexamples.rbs +29 -0
- data/sig/lrama/grammar/symbol.rbs +1 -1
- data/sig/lrama/grammar/symbols/resolver.rbs +3 -3
- data/sig/lrama/grammar.rbs +13 -0
- data/sig/lrama/state/reduce_reduce_conflict.rbs +2 -2
- data/sig/lrama/state.rbs +79 -0
- data/sig/lrama/states.rbs +101 -0
- metadata +17 -2
@@ -16,7 +16,7 @@ module Lrama
|
|
16
16
|
return unless user_code
|
17
17
|
|
18
18
|
resolved = Lexer::Token::UserCode.new(s_value: user_code.s_value, location: user_code.location)
|
19
|
-
var_to_arg = {}
|
19
|
+
var_to_arg = {} #: Hash[String, String]
|
20
20
|
symbols.each do |sym|
|
21
21
|
resolved_sym = bindings.resolve_symbol(sym)
|
22
22
|
if resolved_sym != sym
|
@@ -67,7 +67,7 @@ module Lrama
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def resolve_inline_rules
|
70
|
-
resolved_builders = []
|
70
|
+
resolved_builders = [] #: Array[RuleBuilder]
|
71
71
|
rhs.each_with_index do |token, i|
|
72
72
|
if (inline_rule = @parameterizing_rule_resolver.find_inline(token))
|
73
73
|
inline_rule.rhs_list.each do |inline_rhs|
|
data/lib/lrama/grammar.rb
CHANGED
@@ -30,7 +30,7 @@ module Lrama
|
|
30
30
|
:after_shift, :before_reduce, :after_reduce, :after_shift_error_token, :after_pop_stack,
|
31
31
|
:symbols_resolver, :types, :rules, :rule_builders, :sym_to_rules, :no_stdlib, :locations
|
32
32
|
|
33
|
-
def_delegators "@symbols_resolver", :symbols, :nterms, :terms, :add_nterm, :add_term,
|
33
|
+
def_delegators "@symbols_resolver", :symbols, :nterms, :terms, :add_nterm, :add_term, :find_term_by_s_value,
|
34
34
|
:find_symbol_by_number!, :find_symbol_by_id!, :token_to_symbol,
|
35
35
|
:find_symbol_by_s_value!, :fill_symbol_number, :fill_nterm_type,
|
36
36
|
:fill_printer, :fill_destructor, :fill_error_token, :sort_by_number!
|
@@ -382,7 +382,7 @@ module Lrama
|
|
382
382
|
end
|
383
383
|
|
384
384
|
def validate_rule_lhs_is_nterm!
|
385
|
-
errors = []
|
385
|
+
errors = [] #: Array[String]
|
386
386
|
|
387
387
|
rules.each do |rule|
|
388
388
|
next if rule.lhs.nterm?
|