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

type-ruby / t-ruby / 20478251574
76%

Build:
DEFAULT BRANCH: main
Ran 24 Dec 2025 04:29AM UTC
Jobs 1
Files 34
Run time 99min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Dec 2025 04:29AM UTC coverage: 75.882% (+0.2%) from 75.685%
20478251574

push

github

web-flow
fix: support Unicode method names in parser and compiler (#12)

* test: add failing tests for Unicode method names

Add test cases for non-ASCII method name parsing:
- Korean characters (안녕하세요)
- Mixed ASCII and Unicode (비_영어_함수명___테스트1!)
- Japanese characters (こんにちは)
- Class methods with Unicode names

All tests currently fail due to \w regex pattern limitation.

Related to #11

* fix: support Unicode method names in parser and compiler

Replace \w regex pattern with [\p{L}\p{N}_] to support non-ASCII
characters (Korean, Japanese, etc.) in method names.

Changes:
- Add IDENTIFIER_CHAR and METHOD_NAME_PATTERN constants
- Update parser.rb to detect Unicode method definitions
- Update compiler.rb to strip type annotations from Unicode methods

Fixes #11

* fix: parse conditional expressions for union type inference

Add parse_conditional method to BodyParser that properly parses
if/unless/elsif/else blocks into IR::Conditional nodes. This enables
the type inference system to collect all possible return values from
conditional branches and unify them into union types.

The fix handles:
- Simple if/else blocks
- elsif chains (parsed as nested if)
- unless statements
- Nested conditionals at correct depth

Fixes #13

* fix: ignore unreachable code after return in type inference

Modified collect_returns_recursive to return a termination flag.
When a return statement is encountered, subsequent code in the same
block is now correctly identified as unreachable and excluded from
type inference.

This ensures that methods like:
  def test
    return false
    if condition
      "string"
    end
  end

Are inferred as returning `bool` instead of `bool | String`.

66 of 74 new or added lines in 4 files covered. (89.19%)

5031 of 6630 relevant lines covered (75.88%)

1173.72 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
8
90.49
-1.64% lib/t_ruby/body_parser.rb
Jobs
ID Job ID Ran Files Coverage
1 20478251574.1 24 Dec 2025 04:29AM UTC 34
75.88
GitHub Action Run
Source Files on build 20478251574
  • Tree
  • List 34
  • Changed 5
  • Source Changed 4
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20478251574
  • a32530d8 on github
  • Prev Build on main (#20477240232)
  • Next Build on main (#20479786397)
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

© 2025 Coveralls, Inc