-
Notifications
You must be signed in to change notification settings - Fork 0
Functions #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
WilliamRagstad
wants to merge
56
commits into
main
Choose a base branch
from
functions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Functions #38
Conversation
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
Implemented parsing of the unit type '()' as an empty tuple in the parser and added corresponding handling in the type checker. Refactored CheckedAst and related code to use 'ty' and 'ret_ty' fields for consistency. Added tests for unit parsing and invalid function calls involving unit type.
Refactors the record field parsing logic to use `parse_expr(COMMA_PREC)` instead of `parse_top_expr` for value parsing, ensuring correct precedence handling. Also updates token consumption and tracking of the last token's line info for better error reporting and parsing accuracy.
Removed TokenKind::Newline from the is_terminator check in the lexer. Updated parser tests to unwrap the result earlier and add debugging output for unexpected cases.
The specialize module has been moved from core/src/parser to core/src/type_checker, and related imports and module declarations have been updated accordingly. Intrinsic operator definitions and constants were relocated from op.rs to parser.rs. Type handling logic was removed from the parser, and function signatures were updated to reflect these changes.
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.
This pull request introduces several updates and improvements across multiple components of the codebase, focusing on enhanced debugging, code refactoring, and feature modifications. Key changes include adding debug logging, refactoring assignment evaluation, updating lexer functionality, and removing the
Comma
token type.Debugging Enhancements
eval_all
to log the number and content of expressions being evaluated.eval_expr
to log expressions usingprint_expr
instead ofprint_sexpr
for improved clarity.Refactoring and Code Simplification
eval_assignment
function to handle assignment expressions more robustly, supporting complex patterns like function definition sugar, destructuring to tuples, records, and lists.CheckedAst::FunctionDef
withCheckedAst::Lambda
for consistency in function definitions.print_error_report
.Lexer Improvements
Lexer
instances from various sources (e.g., strings, files, stdin).Comma
token type with an operator token (Op(",".to_string())
) for consistency in token handling [1] [2].Feature Updates
UnsignedInteger
,SignedInteger
, andRecordKey
enums with theHash
trait to support their use as keys in hash-based collections [1] [2].Testing Adjustments
Comma
token and the introduction ofeval_assignment
andCheckedAst::Lambda
[1] [2].These changes collectively enhance the maintainability, functionality, and debugging capabilities of the codebase, aligning with best practices for extensibility and clarity.