lib/lrama/context.rb in lrama-0.1.0 vs lib/lrama/context.rb in lrama-0.2.0

- old
+ new

@@ -16,11 +16,11 @@ @yydefact = nil @yydefgoto = nil # Array of array @_actions = [] - report_duration(:compute_tables) { compute_tables } + compute_tables end # enum yytokentype def yytokentype @states.terms.reject do |term| @@ -185,15 +185,15 @@ # * yytable # * yycheck # * yypact_ninf # * yytable_ninf def compute_tables - compute_yydefact - compute_yydefgoto - sort_actions + report_duration(:compute_yydefact) { compute_yydefact } + report_duration(:compute_yydefgoto) { compute_yydefgoto } + report_duration(:sort_actions) { sort_actions } # debug_sorted_actions - compute_packed_table + report_duration(:compute_packed_table) { compute_packed_table } end def vectors_count @states.states.count + @states.nterms.count end @@ -436,13 +436,14 @@ loc = res + from if @table[loc] # If the cell of table is set, can not use the cell. ok = false + break end end - if userd_res[res] + if ok && userd_res[res] ok = false end if ok break