forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store source in an Arc<str> (FuelLabs#483)
* make fields of Ident private * Make Ident<'sc> not hold a &'sc str * rename Ident::primary_name to Ident::as_str * impl fmt::Display for Ident * use Idents in warnings, rather than str * use Idents in CompileError rather than &str * switch to static spans * remove pest dependency from forc and sway-server * use Arc-based pest from github * fix clippy lints * remove remaining unused 'sc lifetimes * run rustfmt
- Loading branch information
Showing
103 changed files
with
2,501 additions
and
2,702 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use super::Expression; | ||
|
||
#[derive(Debug, Clone)] | ||
pub(crate) enum MatchCondition { | ||
CatchAll, | ||
Expression(Box<Expression>), | ||
} |
10 changes: 10 additions & 0 deletions
10
core_lang/src/semantic_analysis/ast_node/expression/match_branch.rs
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,10 @@ | ||
use super::*; | ||
use crate::semantic_analysis::ast_node::TypedCodeBlock; | ||
use either::Either; | ||
|
||
#[allow(dead_code)] | ||
#[derive(Clone, Debug)] | ||
pub(crate) struct TypedMatchBranch { | ||
condition: TypedMatchCondition, | ||
result: Either<TypedCodeBlock, TypedExpression>, | ||
} |
8 changes: 8 additions & 0 deletions
8
core_lang/src/semantic_analysis/ast_node/expression/match_condition.rs
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,8 @@ | ||
use crate::semantic_analysis::TypedExpression; | ||
|
||
#[allow(dead_code)] | ||
#[derive(Clone, Debug)] | ||
pub(crate) enum TypedMatchCondition { | ||
CatchAll, | ||
Expression(Box<TypedExpression>), | ||
} |
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,25 @@ | ||
use crate::build_config::BuildConfig; | ||
use crate::control_flow_analysis::ControlFlowGraph; | ||
use crate::parse_tree::declaration::Purity; | ||
use crate::semantic_analysis::{ast_node::Mode, Namespace}; | ||
use crate::type_engine::*; | ||
|
||
use std::collections::{HashMap, HashSet}; | ||
pub struct TypeCheckArguments<'a, T> { | ||
pub(crate) checkee: T, | ||
pub(crate) namespace: &'a mut Namespace, | ||
pub(crate) crate_namespace: Option<&'a Namespace>, | ||
pub(crate) return_type_annotation: TypeId, | ||
pub(crate) help_text: &'static str, | ||
pub(crate) self_type: TypeId, | ||
pub(crate) build_config: &'a BuildConfig, | ||
pub(crate) dead_code_graph: &'a mut ControlFlowGraph, | ||
pub(crate) mode: Mode, | ||
pub(crate) dependency_graph: &'a mut HashMap<String, HashSet<String>>, | ||
pub(crate) opts: TCOpts, | ||
} | ||
|
||
#[derive(Default, Clone, Copy)] | ||
pub struct TCOpts { | ||
pub(crate) purity: Purity, | ||
} |
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
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
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
Oops, something went wrong.