• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

type-ruby / t-ruby / 20560733162

28 Dec 2025 10:59PM UTC coverage: 79.076% (+1.7%) from 77.331%
20560733162

Pull #29

github

web-flow
Merge 5e12f0648 into fda099366
Pull Request #29: refactor: migrate parser from regex to token-based parser combinator

1849 of 2098 new or added lines in 53 files covered. (88.13%)

6 existing lines in 2 files now uncovered.

6644 of 8402 relevant lines covered (79.08%)

908.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.41
/lib/t_ruby/parser_combinator/token/token_many1.rb
1
# frozen_string_literal: true
2

3
module TRuby
1✔
4
  module ParserCombinator
1✔
5
    # Many1: one or more
6
    class TokenMany1 < TokenParser
1✔
7
      def initialize(parser)
1✔
NEW
8
        @parser = parser
×
9
      end
10

11
      def parse(tokens, position = 0)
1✔
NEW
12
        first = @parser.parse(tokens, position)
×
NEW
13
        return first if first.failure?
×
14

NEW
15
        results = [first.value]
×
NEW
16
        current_pos = first.position
×
17

NEW
18
        loop do
×
NEW
19
          result = @parser.parse(tokens, current_pos)
×
NEW
20
          break if result.failure?
×
21

NEW
22
          results << result.value
×
NEW
23
          break if result.position == current_pos
×
24

NEW
25
          current_pos = result.position
×
26
        end
27

NEW
28
        TokenParseResult.success(results, tokens, current_pos)
×
29
      end
30
    end
31
  end
32
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc