Implement Hindley-Milner-based type inference#5
Merged
walker84837 merged 8 commits intomainfrom Jan 8, 2026
Merged
Conversation
Changes also include: - Change `int` to `Int` and `float` to `Float` in Kit comment examples to use correct types - Remove "int" and "float" as correct types in types.rs - Make CompileResult<T> part of `error` module.
Implemented `parse_bool_literal` to centralize boolean parsing. Replaced inline boolean match with helper call. Extended primary token check to include `true` and `false`. Summary of changes: - Added `parse_bool_literal` method - Updated `Rule::boolean` handling to use the new helper - Modified primary keyword match to route booleans through the helper
3f8bc2b to
7940459
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of now, there is no type inference when evaluating types like
var something;and the goal of this PR is to implement a type inference system (Hindley-Milner) to properly evaluate to the correct types.Later on, type inference should be expanded to also parse C headers (and Kit modules).