- Notifications
You must be signed in to change notification settings - Fork 5
Basic execution elements and basic skr_app calls #44
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
base: main
Are you sure you want to change the base?
Basic execution elements and basic skr_app calls #44
Conversation
Alexiscomete commented Jul 7, 2025
- u32 type only
- column in tokens
- error display (base) and hints
- create a variable
- edit a variable
- do basic calculations with u32
- print variable (with or without a new line)
- get user input
- assert that two values are equal
…g mut to context, separating OpI and OpO
Fix priority for VarDec We will need to add a function to dump newlines
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds core execution support for the SKR language, introduces a CharsIterator
to track token positions, and implements native calls (print
, println
, read_int
, assert_eq
) with detailed error handling and hints.
- Refactor tokenizer to
CharsIterator
carrying line/column information - Implement
ExecutionContext
, ASTEvaluate
/Execute
traits, and native calls - Update all
GraphDisplay
impls to include indentation for clearer flowcharts
Reviewed Changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test1, test2, test3 | Added flowchart outputs for basic calculations and variable ops |
test.skrb | Updated example script to use new syntax and demonstrate calls |
src/utils.rs | Enhanced cross‐platform clear using ANSI codes and improved doc |
src/tokens.rs | Refactored tokenizer to use CharsIterator for line/column info |
src/execute.rs | Built ExecutionContext , variable scopes, native call handling |
src/parse/nodes/* | Added Evaluate /Execute impls and updated GraphDisplay APIs |
src/main.rs | Improved CLI flow, --show-ast , colored output, error handling |
README.md | Markdown formatting fix |
Cargo.toml | Added colored dependency |
Comments suppressed due to low confidence (1)
src/execute.rs:5
- [nitpick] Aliasing primitives as
OperationI
/OperationO
can be confusing; consider using more descriptive names such asEvalInput
/EvalResult
orValue
/Result
to clarify their roles.
pub type OperationI = u32;