-
Notifications
You must be signed in to change notification settings - Fork 659
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
Interpreter. #28441
Draft
mikebenfield
wants to merge
11
commits into
mainnet
Choose a base branch
from
interpreter
base: mainnet
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.
+3,636
−5
Draft
Interpreter. #28441
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9e1108e
Interpreter.
mikebenfield 330b14d
Breakpoints, mapping fixes, respect project structure, cleanup.
mikebenfield d5d9b8a
support Rand core functions
mikebenfield 0cbdf63
version fix
mikebenfield db26db5
some doc comments
mikebenfield 552d74b
some doc comments
mikebenfield 1c65b3c
await
mikebenfield f74c851
check for empty frames
mikebenfield 2814dfe
fix
mikebenfield ff6a321
doc fix
mikebenfield 4dd04ff
futures in tuple return
mikebenfield File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (C) 2019-2024 Aleo Systems Inc. | ||
// This file is part of the Leo library. | ||
|
||
// The Leo library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// The Leo library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
use std::fmt; | ||
|
||
use leo_span::Span; | ||
|
||
/// Represents the interpreter halting, which should not be considered an | ||
/// actual runtime error. | ||
#[derive(Clone, Debug, Error)] | ||
pub struct InterpreterHalt { | ||
/// Optional Span where the halt occurred. | ||
span: Option<Span>, | ||
|
||
/// User visible message. | ||
message: String, | ||
} | ||
|
||
impl InterpreterHalt { | ||
pub fn new(message: String) -> Self { | ||
InterpreterHalt { span: None, message } | ||
} | ||
|
||
pub fn new_spanned(message: String, span: Span) -> Self { | ||
InterpreterHalt { span: Some(span), message } | ||
} | ||
|
||
pub fn span(&self) -> Option<Span> { | ||
self.span | ||
} | ||
} | ||
|
||
impl fmt::Display for InterpreterHalt { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
write!(f, "{}", self.message) | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[package] | ||
name = "leo-interpreter" | ||
version = "2.3.0" | ||
authors = [ "The Leo Team <[email protected]>" ] | ||
description = "Interpreter for the Leo programming language" | ||
homepage = "https://leo-lang.org" | ||
repository = "https://github.com/ProvableHQ/leo" | ||
keywords = [ | ||
"aleo", | ||
"cryptography", | ||
"leo", | ||
"programming-language", | ||
"zero-knowledge" | ||
] | ||
categories = [ "compilers", "cryptography", "web-programming" ] | ||
include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] | ||
license = "GPL-3.0" | ||
edition = "2021" | ||
rust-version = "1.82.0" | ||
|
||
[dependencies.snarkvm-circuit] | ||
version = "1.0.0" | ||
|
||
[dependencies.snarkvm] | ||
workspace = true | ||
|
||
[dependencies.leo-ast] | ||
workspace = true | ||
|
||
[dependencies.leo-passes] | ||
workspace = true | ||
|
||
[dependencies.leo-errors] | ||
workspace = true | ||
|
||
[dependencies.leo-parser] | ||
workspace = true | ||
|
||
[dependencies.leo-span] | ||
workspace = true | ||
|
||
[dependencies.colored] | ||
workspace = true | ||
|
||
[dependencies.indexmap] | ||
workspace = true | ||
|
||
[dependencies.rand] | ||
workspace = true | ||
|
||
[dependencies.rand_chacha] | ||
workspace = true |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Should we give these a proper error code?