mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 23:52:02 +03:00
spans: use source map backing
This commit is contained in:
parent
aec59cc182
commit
a5ad874ffb
@ -37,7 +37,7 @@ version = "1.5.3"
|
||||
[dependencies.sha2]
|
||||
version = "0.10"
|
||||
|
||||
[dev-dependencies.leo-span]
|
||||
[dependencies.leo-span]
|
||||
path = "../../leo/span"
|
||||
version = "1.5.3"
|
||||
|
||||
|
@ -31,6 +31,8 @@ use leo_errors::emitter::Handler;
|
||||
use leo_errors::{CompilerError, Result};
|
||||
pub use leo_passes::SymbolTable;
|
||||
use leo_passes::*;
|
||||
use leo_span::source_map::FileName;
|
||||
use leo_span::symbol::with_session_globals;
|
||||
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::fs;
|
||||
@ -77,13 +79,11 @@ impl<'a> Compiler<'a> {
|
||||
}
|
||||
|
||||
// Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
|
||||
pub fn parse_program_from_string(&mut self, program_string: &str) -> Result<()> {
|
||||
pub fn parse_program_from_string(&mut self, program_string: &str, name: FileName) -> Result<()> {
|
||||
let prg_sf = with_session_globals(|s| s.source_map.new_source(program_string, name));
|
||||
|
||||
// Use the parser to construct the abstract syntax tree (ast).
|
||||
let ast: leo_ast::Ast = leo_parser::parse_ast(
|
||||
self.handler,
|
||||
self.main_file_path.to_str().unwrap_or_default(),
|
||||
program_string,
|
||||
)?;
|
||||
let ast: leo_ast::Ast = leo_parser::parse_ast(self.handler, &prg_sf.src, prg_sf.start_pos)?;
|
||||
// Write the AST snapshot post parsing.
|
||||
ast.to_json_file_without_keys(self.output_directory.clone(), "initial_ast.json", &["span"])?;
|
||||
|
||||
@ -96,31 +96,24 @@ impl<'a> Compiler<'a> {
|
||||
pub fn parse_program(&mut self) -> Result<()> {
|
||||
// Load the program file.
|
||||
let program_string = fs::read_to_string(&self.main_file_path)
|
||||
.map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?;
|
||||
.map_err(|e| CompilerError::file_read_error(&self.main_file_path, e))?;
|
||||
|
||||
self.parse_program_from_string(&program_string)
|
||||
}
|
||||
|
||||
/// Parses and stores the input file, constructs a syntax tree, and generates a program input.
|
||||
pub fn parse_input_from_string(&mut self, input_file_path: PathBuf, input_string: &str) -> Result<()> {
|
||||
let input_ast =
|
||||
leo_parser::parse_input(self.handler, input_file_path.to_str().unwrap_or_default(), input_string)?;
|
||||
input_ast.to_json_file_without_keys(self.output_directory.clone(), "inital_input_ast.json", &["span"])?;
|
||||
|
||||
self.input_ast = Some(input_ast);
|
||||
Ok(())
|
||||
self.parse_program_from_string(&program_string, FileName::Real(self.main_file_path.clone()))
|
||||
}
|
||||
|
||||
/// Parses and stores the input file, constructs a syntax tree, and generates a program input.
|
||||
pub fn parse_input(&mut self, input_file_path: PathBuf) -> Result<()> {
|
||||
// Load the input file if it exists.
|
||||
if input_file_path.exists() {
|
||||
let input_string = fs::read_to_string(&input_file_path)
|
||||
.map_err(|e| CompilerError::file_read_error(input_file_path.clone(), e))?;
|
||||
// Load the input file, as it exists.
|
||||
let input_sf = with_session_globals(|s| s.source_map.load_file(&input_file_path))
|
||||
.map_err(|e| CompilerError::file_read_error(&input_file_path, e))?;
|
||||
|
||||
self.parse_input_from_string(input_file_path, &input_string)?;
|
||||
// Parse and serialize it.
|
||||
let input_ast = leo_parser::parse_input(self.handler, &input_sf.src, input_sf.start_pos)?;
|
||||
input_ast.to_json_file_without_keys(self.output_directory.clone(), "inital_input_ast.json", &["span"])?;
|
||||
|
||||
self.input_ast = Some(input_ast);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ use leo_errors::{
|
||||
LeoError, LeoWarning,
|
||||
};
|
||||
use leo_passes::SymbolTable;
|
||||
use leo_span::symbol::create_session_if_not_set_then;
|
||||
use leo_span::{source_map::FileName, symbol::create_session_if_not_set_then};
|
||||
use leo_test_framework::{
|
||||
runner::{Namespace, ParseType, Runner},
|
||||
Test,
|
||||
@ -48,8 +48,9 @@ fn parse_program<'a>(
|
||||
program_string: &str,
|
||||
cwd: Option<PathBuf>,
|
||||
) -> Result<Compiler<'a>, LeoError> {
|
||||
let mut compiler = new_compiler(handler, cwd.unwrap_or_else(|| "compiler-test".into()));
|
||||
compiler.parse_program_from_string(program_string)?;
|
||||
let mut compiler = new_compiler(handler, cwd.clone().unwrap_or_else(|| "compiler-test".into()));
|
||||
let name = cwd.map_or_else(|| FileName::Custom("compiler-test".into()), FileName::Real);
|
||||
compiler.parse_program_from_string(program_string, name)?;
|
||||
|
||||
Ok(compiler)
|
||||
}
|
||||
|
@ -44,11 +44,14 @@ struct Opt {
|
||||
|
||||
fn main() -> Result<(), String> {
|
||||
let opt = Opt::from_args();
|
||||
let input_string = fs::read_to_string(&opt.input_path).expect("failed to open an input file");
|
||||
let input_tree = create_session_if_not_set_then(|_| {
|
||||
let input_tree = create_session_if_not_set_then(|s| {
|
||||
let input_string = s
|
||||
.source_map
|
||||
.load_file(&opt.input_path)
|
||||
.expect("failed to open an input file");
|
||||
|
||||
Handler::with(|handler| {
|
||||
let input =
|
||||
leo_parser::parse_program_inputs(handler, input_string.clone(), opt.input_path.to_str().unwrap())?;
|
||||
let input = leo_parser::parse_program_inputs(handler, &input_string.src, input_string.start_pos)?;
|
||||
input.to_json_string()
|
||||
})
|
||||
.map_err(|e| e.to_string())
|
||||
|
@ -42,12 +42,12 @@ struct Opt {
|
||||
|
||||
fn main() -> Result<(), String> {
|
||||
let opt = Opt::from_args();
|
||||
let code = fs::read_to_string(&opt.input_path).expect("failed to open file");
|
||||
|
||||
// Parses the Leo file constructing an ast which is then serialized.
|
||||
let serialized_leo_tree = create_session_if_not_set_then(|_| {
|
||||
let serialized_leo_tree = create_session_if_not_set_then(|s| {
|
||||
let code = s.source_map.load_file(&opt.input_path).expect("failed to open file");
|
||||
|
||||
Handler::with(|h| {
|
||||
let ast = leo_parser::parse_ast(h, opt.input_path.to_str().unwrap(), &code)?;
|
||||
let ast = leo_parser::parse_ast(h, &code.src, code.start_pos)?;
|
||||
let json = Ast::to_json_string(&ast)?;
|
||||
println!("{}", json);
|
||||
Ok(json)
|
||||
|
@ -23,6 +23,7 @@
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
||||
pub(crate) mod tokenizer;
|
||||
use leo_span::span::BytePos;
|
||||
pub use tokenizer::KEYWORD_TOKENS;
|
||||
pub(crate) use tokenizer::*;
|
||||
|
||||
@ -37,18 +38,13 @@ use leo_errors::Result;
|
||||
mod test;
|
||||
|
||||
/// Creates a new AST from a given file path and source code text.
|
||||
pub fn parse_ast<T: AsRef<str>, Y: AsRef<str>>(handler: &Handler, path: T, source: Y) -> Result<Ast> {
|
||||
Ok(Ast::new(parser::parse(handler, path.as_ref(), source.as_ref())?))
|
||||
pub fn parse_ast(handler: &Handler, source: &str, start_pos: BytePos) -> Result<Ast> {
|
||||
Ok(Ast::new(parser::parse(handler, source, start_pos)?))
|
||||
}
|
||||
|
||||
/// Parses program inputs from from the input file path and state file path
|
||||
pub fn parse_program_inputs<T: AsRef<str>, Y: AsRef<str>>(
|
||||
handler: &Handler,
|
||||
input_string: T,
|
||||
input_path: Y,
|
||||
) -> Result<Input> {
|
||||
let program_input: ProgramInput =
|
||||
parser::parse_input(handler, input_path.as_ref(), input_string.as_ref())?.try_into()?;
|
||||
pub fn parse_program_inputs(handler: &Handler, input_string: &str, start_pos: BytePos) -> Result<Input> {
|
||||
let program_input: ProgramInput = parser::parse_input(handler, input_string, start_pos)?.try_into()?;
|
||||
|
||||
Ok(Input {
|
||||
program_input,
|
||||
|
@ -27,6 +27,7 @@ use leo_errors::{ParserError, Result};
|
||||
use leo_span::Span;
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use leo_span::span::BytePos;
|
||||
use std::unreachable;
|
||||
|
||||
mod context;
|
||||
@ -39,10 +40,8 @@ pub mod statement;
|
||||
pub mod type_;
|
||||
|
||||
pub(crate) fn assert_no_whitespace(left_span: &Span, right_span: &Span, left: &str, right: &str) -> Result<()> {
|
||||
if left_span.col_stop != right_span.col_start {
|
||||
let mut error_span = left_span + right_span;
|
||||
error_span.col_start = left_span.col_stop - 1;
|
||||
error_span.col_stop = right_span.col_start - 1;
|
||||
if left_span.hi != right_span.lo {
|
||||
let error_span = Span::new(left_span.hi, right_span.lo); // The span between them.
|
||||
return Err(ParserError::unexpected_whitespace(left, right, &error_span).into());
|
||||
}
|
||||
|
||||
@ -50,15 +49,15 @@ pub(crate) fn assert_no_whitespace(left_span: &Span, right_span: &Span, left: &s
|
||||
}
|
||||
|
||||
/// Creates a new program from a given file path and source code text.
|
||||
pub fn parse(handler: &Handler, path: &str, source: &str) -> Result<Program> {
|
||||
let mut tokens = ParserContext::new(handler, crate::tokenize(path, source)?);
|
||||
pub fn parse(handler: &Handler, source: &str, start_pos: BytePos) -> Result<Program> {
|
||||
let mut tokens = ParserContext::new(handler, crate::tokenize(source, start_pos)?);
|
||||
|
||||
tokens.parse_program()
|
||||
}
|
||||
|
||||
/// Parses an input file at the given file `path` and `source` code text.
|
||||
pub fn parse_input<T: AsRef<str>, Y: AsRef<str>>(handler: &Handler, path: T, source: Y) -> Result<InputAst> {
|
||||
let mut tokens = ParserContext::new(handler, crate::tokenize(path.as_ref(), source.as_ref())?);
|
||||
pub fn parse_input(handler: &Handler, source: &str, start_pos: BytePos) -> Result<InputAst> {
|
||||
let mut tokens = ParserContext::new(handler, crate::tokenize(source, start_pos)?);
|
||||
|
||||
tokens.parse_input()
|
||||
}
|
||||
|
@ -17,7 +17,11 @@
|
||||
use crate::{tokenizer, ParserContext, SpannedToken};
|
||||
use leo_ast::{Expression, ExpressionStatement, Statement, ValueExpression};
|
||||
use leo_errors::{emitter::Handler, LeoError};
|
||||
use leo_span::{symbol::create_session_if_not_set_then, Span};
|
||||
use leo_span::{
|
||||
source_map::FileName,
|
||||
symbol::{create_session_if_not_set_then, SessionGlobals},
|
||||
Span,
|
||||
};
|
||||
use leo_test_framework::{
|
||||
runner::{Namespace, ParseType, Runner},
|
||||
Test,
|
||||
@ -34,9 +38,8 @@ impl Namespace for TokenNamespace {
|
||||
}
|
||||
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
create_session_if_not_set_then(|_| {
|
||||
tokenizer::tokenize("test", &test.content)
|
||||
.map(|tokens| {
|
||||
create_session_if_not_set_then(|s| {
|
||||
tokenize(test, s).map(|tokens| {
|
||||
Value::String(
|
||||
tokens
|
||||
.into_iter()
|
||||
@ -45,7 +48,6 @@ impl Namespace for TokenNamespace {
|
||||
.join(","),
|
||||
)
|
||||
})
|
||||
.map_err(|x| x.to_string())
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -76,8 +78,9 @@ fn with_handler<T>(
|
||||
Ok(parsed)
|
||||
}
|
||||
|
||||
fn tokenize(test: Test) -> Result<Vec<SpannedToken>, String> {
|
||||
tokenizer::tokenize("test", &test.content).map_err(|x| x.to_string())
|
||||
fn tokenize(test: Test, s: &SessionGlobals) -> Result<Vec<SpannedToken>, String> {
|
||||
let sf = s.source_map.new_source(&test.content, FileName::Custom("test".into()));
|
||||
tokenizer::tokenize(&sf.src, sf.start_pos).map_err(|x| x.to_string())
|
||||
}
|
||||
|
||||
fn all_are_comments(tokens: &[SpannedToken]) -> bool {
|
||||
@ -98,8 +101,8 @@ impl Namespace for ParseExpressionNamespace {
|
||||
}
|
||||
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let tokenizer = tokenize(test)?;
|
||||
create_session_if_not_set_then(|s| {
|
||||
let tokenizer = tokenize(test, s)?;
|
||||
if all_are_comments(&tokenizer) {
|
||||
return Ok(yaml_or_fail(""));
|
||||
}
|
||||
@ -116,8 +119,8 @@ impl Namespace for ParseStatementNamespace {
|
||||
}
|
||||
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let tokenizer = tokenize(test)?;
|
||||
create_session_if_not_set_then(|s| {
|
||||
let tokenizer = tokenize(test, s)?;
|
||||
if all_are_comments(&tokenizer) {
|
||||
return Ok(yaml_or_fail(Statement::Expression(ExpressionStatement {
|
||||
expression: Expression::Value(ValueExpression::String(Vec::new(), Default::default())),
|
||||
@ -137,7 +140,7 @@ impl Namespace for ParseNamespace {
|
||||
}
|
||||
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
create_session_if_not_set_then(|_| with_handler(tokenize(test)?, |p| p.parse_program()).map(yaml_or_fail))
|
||||
create_session_if_not_set_then(|s| with_handler(tokenize(test, s)?, |p| p.parse_program()).map(yaml_or_fail))
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,8 +196,8 @@ impl Namespace for SerializeNamespace {
|
||||
}
|
||||
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let tokenizer = tokenize(test)?;
|
||||
create_session_if_not_set_then(|s| {
|
||||
let tokenizer = tokenize(test, s)?;
|
||||
let parsed = with_handler(tokenizer, |p| p.parse_program())?;
|
||||
|
||||
let mut json = serde_json::to_value(parsed).expect("failed to convert to json value");
|
||||
@ -214,7 +217,7 @@ impl Namespace for InputNamespace {
|
||||
}
|
||||
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
create_session_if_not_set_then(|_| with_handler(tokenize(test)?, |p| p.parse_input()).map(yaml_or_fail))
|
||||
create_session_if_not_set_then(|s| with_handler(tokenize(test, s)?, |p| p.parse_input()).map(yaml_or_fail))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
pub(crate) mod token;
|
||||
use std::iter;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use self::token::KEYWORD_TOKENS;
|
||||
pub(crate) use self::token::*;
|
||||
@ -30,78 +29,38 @@ pub(crate) mod lexer;
|
||||
pub(crate) use self::lexer::*;
|
||||
|
||||
use leo_errors::{ParserError, Result};
|
||||
use leo_span::Span;
|
||||
use leo_span::{
|
||||
span::{BytePos, Pos},
|
||||
Span,
|
||||
};
|
||||
|
||||
/// Creates a new vector of spanned tokens from a given file path and source code text.
|
||||
pub(crate) fn tokenize(path: &str, input: &str) -> Result<Vec<SpannedToken>> {
|
||||
tokenize_iter(path, input).collect()
|
||||
pub(crate) fn tokenize(input: &str, start_pos: BytePos) -> Result<Vec<SpannedToken>> {
|
||||
tokenize_iter(input, start_pos).collect()
|
||||
}
|
||||
|
||||
/// Yields spanned tokens from a given file path and source code text.
|
||||
pub(crate) fn tokenize_iter<'a>(path: &'a str, input: &'a str) -> impl 'a + Iterator<Item = Result<SpannedToken>> {
|
||||
let path = Arc::new(path.to_string());
|
||||
/// Yields spanned tokens from the given source code text.
|
||||
///
|
||||
/// The `lo` byte position determines where spans will start.
|
||||
pub(crate) fn tokenize_iter<'a>(input: &'a str, mut lo: BytePos) -> impl 'a + Iterator<Item = Result<SpannedToken>> {
|
||||
let mut index = 0usize;
|
||||
let mut line_no = 1usize;
|
||||
let mut line_start = 0usize;
|
||||
iter::from_fn(move || {
|
||||
while input.len() > index {
|
||||
let token = match Token::eat(&input[index..]) {
|
||||
let (token_len, token) = match Token::eat(&input[index..]) {
|
||||
Err(e) => return Some(Err(e)),
|
||||
Ok(t) => t,
|
||||
};
|
||||
index += token_len;
|
||||
|
||||
let span = Span::new(lo, lo + BytePos::from_usize(token_len));
|
||||
lo = span.hi;
|
||||
|
||||
match token {
|
||||
(token_len, Token::WhiteSpace) => {
|
||||
let bytes = input.as_bytes();
|
||||
if bytes[index] == 0x000D && matches!(bytes.get(index + 1), Some(0x000A)) {
|
||||
// Check carriage return followed by newline.
|
||||
line_no += 1;
|
||||
line_start = index + token_len + 1;
|
||||
index += token_len;
|
||||
} else if matches!(bytes[index], 0x000A | 0x000D) {
|
||||
// Check new-line or carriage-return
|
||||
line_no += 1;
|
||||
line_start = index + token_len;
|
||||
}
|
||||
index += token_len;
|
||||
}
|
||||
(token_len, token) => {
|
||||
let mut span = Span::new(
|
||||
line_no,
|
||||
line_no,
|
||||
index - line_start + 1,
|
||||
index - line_start + token_len + 1,
|
||||
path.clone(),
|
||||
input[line_start
|
||||
..input[line_start..]
|
||||
.find('\n')
|
||||
.map(|i| i + line_start)
|
||||
.unwrap_or(input.len())]
|
||||
.to_string(),
|
||||
);
|
||||
match &token {
|
||||
Token::CommentLine(_) => {
|
||||
line_no += 1;
|
||||
line_start = index + token_len;
|
||||
}
|
||||
Token::CommentBlock(block) => {
|
||||
let line_ct = block.chars().filter(|x| *x == '\n').count();
|
||||
line_no += line_ct;
|
||||
if line_ct > 0 {
|
||||
let last_line_index = block.rfind('\n').unwrap();
|
||||
line_start = index + last_line_index + 1;
|
||||
span.col_stop = index + token_len - line_start + 1;
|
||||
}
|
||||
span.line_stop = line_no;
|
||||
}
|
||||
Token::AddressLit(address) if !check_address(address) => {
|
||||
Token::WhiteSpace => continue,
|
||||
Token::AddressLit(address) if !check_address(&address) => {
|
||||
return Some(Err(ParserError::invalid_address_lit(address, &span).into()));
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
index += token_len;
|
||||
return Some(Ok(SpannedToken { token, span }));
|
||||
}
|
||||
_ => return Some(Ok(SpannedToken { token, span })),
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,14 +71,12 @@ pub(crate) fn tokenize_iter<'a>(path: &'a str, input: &'a str) -> impl 'a + Iter
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use leo_span::symbol::create_session_if_not_set_then;
|
||||
use leo_span::{source_map::FileName, symbol::create_session_if_not_set_then};
|
||||
|
||||
#[test]
|
||||
fn test_tokenizer() {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let tokens = tokenize(
|
||||
"test_path",
|
||||
r#"
|
||||
create_session_if_not_set_then(|s| {
|
||||
let raw = r#"
|
||||
'a'
|
||||
'😭'
|
||||
"test"
|
||||
@ -194,9 +151,9 @@ mod tests {
|
||||
?
|
||||
// test
|
||||
/* test */
|
||||
//"#,
|
||||
)
|
||||
.unwrap();
|
||||
//"#;
|
||||
let sf = s.source_map.new_source(raw, FileName::Custom("test".into()));
|
||||
let tokens = tokenize(&sf.src, sf.start_pos).unwrap();
|
||||
let mut output = String::new();
|
||||
for SpannedToken { token, .. } in tokens.iter() {
|
||||
output += &format!("{} ", token);
|
||||
@ -212,7 +169,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_spans() {
|
||||
create_session_if_not_set_then(|_| {
|
||||
create_session_if_not_set_then(|s| {
|
||||
let raw = r#"
|
||||
ppp test
|
||||
// test
|
||||
@ -223,7 +180,10 @@ ppp test
|
||||
test */
|
||||
test
|
||||
"#;
|
||||
let tokens = tokenize("test_path", raw).unwrap();
|
||||
|
||||
let sm = &s.source_map;
|
||||
let sf = sm.new_source(raw, FileName::Custom("test".into()));
|
||||
let tokens = tokenize(&sf.src, sf.start_pos).unwrap();
|
||||
let mut line_indicies = vec![0];
|
||||
for (i, c) in raw.chars().enumerate() {
|
||||
if c == '\n' {
|
||||
@ -231,11 +191,7 @@ ppp test
|
||||
}
|
||||
}
|
||||
for token in tokens.iter() {
|
||||
let token_raw = token.token.to_string();
|
||||
let start = line_indicies.get(token.span.line_start - 1).unwrap();
|
||||
let stop = line_indicies.get(token.span.line_stop - 1).unwrap();
|
||||
let original = &raw[*start + token.span.col_start - 1..*stop + token.span.col_stop - 1];
|
||||
assert_eq!(original, &token_raw);
|
||||
assert_eq!(token.token.to_string(), sm.contents_of_span(token.span).unwrap());
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ use backtrace::Backtrace;
|
||||
use color_backtrace::{BacktracePrinter, Verbosity};
|
||||
use colored::Colorize;
|
||||
use derivative::Derivative;
|
||||
use leo_span::source_map::is_not_test_framework;
|
||||
|
||||
/// The indent for an error message.
|
||||
pub(crate) const INDENT: &str = " ";
|
||||
@ -120,12 +121,7 @@ impl fmt::Display for Backtraced {
|
||||
let message = format!("{kind} [{code}]: {message}", message = self.message,);
|
||||
|
||||
// To avoid the color enabling characters for comparison with test expectations.
|
||||
if std::env::var("LEO_TESTFRAMEWORK")
|
||||
.unwrap_or_default()
|
||||
.trim()
|
||||
.to_owned()
|
||||
.is_empty()
|
||||
{
|
||||
if is_not_test_framework() {
|
||||
if self.error {
|
||||
write!(f, "{}", message.bold().red())?;
|
||||
} else {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
use crate::{Backtraced, INDENT};
|
||||
|
||||
use leo_span::Span;
|
||||
use leo_span::{source_map::SpanLocation, symbol::with_session_globals, Span};
|
||||
|
||||
use backtrace::Backtrace;
|
||||
use color_backtrace::{BacktracePrinter, Verbosity};
|
||||
@ -107,7 +107,18 @@ impl fmt::Display for Formatted {
|
||||
underline
|
||||
};
|
||||
|
||||
let underlined = underline(self.span.col_start, self.span.col_stop);
|
||||
let (loc, contents) = with_session_globals(|s| {
|
||||
(
|
||||
s.source_map
|
||||
.span_to_location(self.span)
|
||||
.unwrap_or_else(|| SpanLocation::dummy()),
|
||||
s.source_map
|
||||
.line_contents_of_span(self.span)
|
||||
.unwrap_or_else(|| "<contents unavailable>".to_owned()),
|
||||
)
|
||||
});
|
||||
|
||||
let underlined = underline(loc.col_start, loc.col_stop);
|
||||
|
||||
let (kind, code) = if self.backtrace.error {
|
||||
("Error", self.error_code())
|
||||
@ -138,17 +149,17 @@ impl fmt::Display for Formatted {
|
||||
"\n{indent }--> {path}:{line_start}:{start}\n\
|
||||
{indent } |\n",
|
||||
indent = INDENT,
|
||||
path = &*self.span.path,
|
||||
line_start = self.span.line_start,
|
||||
start = self.span.col_start,
|
||||
path = &loc.source_file.name,
|
||||
line_start = loc.line_start,
|
||||
start = loc.col_start,
|
||||
)?;
|
||||
|
||||
for (line_no, line) in self.span.content.lines().enumerate() {
|
||||
for (line_no, line) in contents.lines().enumerate() {
|
||||
writeln!(
|
||||
f,
|
||||
"{line_no:width$} | {text}",
|
||||
width = INDENT.len(),
|
||||
line_no = self.span.line_start + line_no,
|
||||
line_no = loc.line_start + line_no,
|
||||
text = line,
|
||||
)?;
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ impl Handler {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::ParserError;
|
||||
use leo_span::Span;
|
||||
use leo_span::{symbol::create_session_if_not_set_then, Span};
|
||||
|
||||
#[test]
|
||||
fn fresh_no_errors() {
|
||||
@ -276,6 +276,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn buffer_works() {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let count_err = |s: String| s.lines().filter(|l| l.contains("Error")).count();
|
||||
|
||||
let res: Result<(), _> = Handler::with(|h| {
|
||||
@ -299,5 +300,6 @@ mod tests {
|
||||
assert_eq!(count_err(res.unwrap_err().to_string()), 2);
|
||||
|
||||
let () = Handler::with(|_| Ok(())).unwrap();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -18,16 +18,8 @@ license = "GPL-3.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
|
||||
[dependencies.fxhash]
|
||||
version = "0.2.1"
|
||||
|
||||
[dependencies.indexmap]
|
||||
version = "1.8"
|
||||
features = ["serde"]
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0.133"
|
||||
features = [ "derive", "rc" ]
|
||||
|
||||
[dependencies.scoped-tls]
|
||||
version = "1.0.0"
|
||||
[dependencies]
|
||||
fxhash = "0.2.1"
|
||||
indexmap = { version = "1.8", features = ["serde"] }
|
||||
serde = { version = "1.0.133", features = [ "derive", "rc" ] }
|
||||
scoped-tls = { version = "1.0.0" }
|
||||
|
@ -23,3 +23,5 @@ pub mod span;
|
||||
pub use span::Span;
|
||||
|
||||
pub mod span_json;
|
||||
|
||||
pub mod source_map;
|
||||
|
441
leo/span/src/source_map.rs
Normal file
441
leo/span/src/source_map.rs
Normal file
@ -0,0 +1,441 @@
|
||||
use crate::span::{BytePos, CharPos, Pos, Span};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
fmt, fs, io,
|
||||
path::{Path, PathBuf},
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
/// The source map containing all recorded sources,
|
||||
/// methods to register new ones,
|
||||
/// and methods to query about spans in relation to recorded sources.
|
||||
#[derive(Default)]
|
||||
pub struct SourceMap {
|
||||
/// The actual source map data.
|
||||
inner: RefCell<SourceMapInner>,
|
||||
}
|
||||
|
||||
/// Actual data of the source map.
|
||||
/// We use this setup for purposes of interior mutability.
|
||||
#[derive(Default)]
|
||||
struct SourceMapInner {
|
||||
/// The address space below this value is currently used by the files in the source map.
|
||||
used_address_space: u32,
|
||||
|
||||
/// All the source files recorded thus far.
|
||||
///
|
||||
/// The list is append-only with mappings from the start byte position
|
||||
/// for fast lookup from a `Span` to its `SourceFile`.
|
||||
source_files: Vec<Rc<SourceFile>>,
|
||||
}
|
||||
|
||||
impl SourceMap {
|
||||
/// Loads the given `path` and returns a `SourceFile` for it.
|
||||
pub fn load_file(&self, path: &Path) -> io::Result<Rc<SourceFile>> {
|
||||
Ok(self.new_source(&fs::read_to_string(path)?, FileName::Real(path.to_owned())))
|
||||
}
|
||||
|
||||
/// Registers `source` under the given file `name`, returning a `SourceFile` back.
|
||||
pub fn new_source(&self, source: &str, name: FileName) -> Rc<SourceFile> {
|
||||
let len = u32::try_from(source.len()).unwrap();
|
||||
let mut inner = self.inner.borrow_mut();
|
||||
let start_pos = inner.try_allocate_address_space(len).unwrap();
|
||||
let source_file = Rc::new(SourceFile::new(name, source.to_owned(), start_pos));
|
||||
inner.source_files.push(source_file.clone());
|
||||
source_file
|
||||
}
|
||||
|
||||
/// Find the index for the source file containing `pos`.
|
||||
fn find_source_file_index(&self, pos: BytePos) -> Option<usize> {
|
||||
self.inner
|
||||
.borrow()
|
||||
.source_files
|
||||
.binary_search_by_key(&pos, |file| file.start_pos)
|
||||
.map_or_else(|p| p.checked_sub(1), Some)
|
||||
}
|
||||
|
||||
/// Find the source file containing `pos`.
|
||||
fn find_source_file(&self, pos: BytePos) -> Option<Rc<SourceFile>> {
|
||||
Some(self.inner.borrow().source_files[self.find_source_file_index(pos)?].clone())
|
||||
}
|
||||
|
||||
/// Finds line column info about a given `pos`.
|
||||
fn find_line_col(&self, pos: BytePos) -> Option<LineCol> {
|
||||
let source_file = self.find_source_file(pos)?;
|
||||
let (line, col) = source_file.lookup_file_pos(pos);
|
||||
Some(LineCol { source_file, line, col })
|
||||
}
|
||||
|
||||
/// Retrives the location (source file, line, col) on the given span.
|
||||
pub fn span_to_location(&self, sp: Span) -> Option<SpanLocation> {
|
||||
let lo = self.find_line_col(sp.lo)?;
|
||||
let hi = self.find_line_col(sp.hi)?;
|
||||
Some(SpanLocation {
|
||||
source_file: lo.source_file,
|
||||
line_start: lo.line,
|
||||
line_stop: hi.line,
|
||||
col_start: lo.col.to_usize() + 1,
|
||||
col_stop: hi.col.to_usize() + 1,
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns a displayable representation of the `span` as a string.
|
||||
pub fn span_to_string(&self, span: Span) -> String {
|
||||
let loc = match self.span_to_location(span) {
|
||||
None => return "no-location".to_string(),
|
||||
Some(l) => l,
|
||||
};
|
||||
|
||||
if loc.line_start == loc.line_stop {
|
||||
format!("{}:{}-{}", loc.line_start, loc.col_start, loc.col_stop)
|
||||
} else {
|
||||
format!(
|
||||
"{}:{}-{}:{}",
|
||||
loc.line_start, loc.col_start, loc.line_stop, loc.col_stop
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the source contents that is spanned by `span`.
|
||||
pub fn contents_of_span(&self, span: Span) -> Option<String> {
|
||||
let begin = self.find_source_file(span.lo)?;
|
||||
let end = self.find_source_file(span.hi)?;
|
||||
assert_eq!(begin.start_pos, end.start_pos);
|
||||
Some(begin.contents_of_span(span))
|
||||
}
|
||||
|
||||
/// Returns the source contents of the lines that `span` is within.
|
||||
///
|
||||
/// That is, if the span refers to `x = 4` in the source code:
|
||||
///
|
||||
/// > ```text
|
||||
/// > // Line 1
|
||||
/// > let x
|
||||
/// > = 4;
|
||||
/// > // Line 4
|
||||
/// > ```
|
||||
///
|
||||
/// then the contents on lines 2 and 3 are returned.
|
||||
pub fn line_contents_of_span(&self, span: Span) -> Option<String> {
|
||||
let begin = self.find_source_file(span.lo)?;
|
||||
let end = self.find_source_file(span.hi)?;
|
||||
assert_eq!(begin.start_pos, end.start_pos);
|
||||
|
||||
let idx_lo = begin.lookup_line(span.lo).unwrap_or(0);
|
||||
let idx_hi = begin.lookup_line(span.hi).unwrap_or(0) + 1;
|
||||
let lo_line_pos = begin.lines[idx_lo];
|
||||
let hi_line_pos = if idx_hi < begin.lines.len() {
|
||||
begin.lines[idx_hi]
|
||||
} else {
|
||||
begin.end_pos
|
||||
};
|
||||
Some(begin.contents_of_span(Span::new(lo_line_pos, hi_line_pos)))
|
||||
}
|
||||
}
|
||||
|
||||
impl SourceMapInner {
|
||||
/// Attempt reserving address space for `size` number of bytes.
|
||||
fn try_allocate_address_space(&mut self, size: u32) -> Option<BytePos> {
|
||||
let current = self.used_address_space;
|
||||
// By adding one, we can distinguish between files, even when they are empty.
|
||||
self.used_address_space = current.checked_add(size)?.checked_add(1)?;
|
||||
Some(BytePos(current))
|
||||
}
|
||||
}
|
||||
|
||||
/// A file name.
|
||||
///
|
||||
/// For now it's simply a wrapper around `PathBuf`,
|
||||
/// but may become more complicated in the future.
|
||||
#[derive(Clone)]
|
||||
pub enum FileName {
|
||||
/// A real file.
|
||||
Real(PathBuf),
|
||||
/// Any sort of description for a source.
|
||||
Custom(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for FileName {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Real(x) if is_not_test_framework() => x.display().fmt(f),
|
||||
Self::Real(_) => Ok(()),
|
||||
Self::Custom(x) => f.write_str(&x),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Is the env var `LEO_TESTFRAMEWORK` not enabled?
|
||||
pub fn is_not_test_framework() -> bool {
|
||||
std::env::var("LEO_TESTFRAMEWORK")
|
||||
.unwrap_or_default()
|
||||
.trim()
|
||||
.to_owned()
|
||||
.is_empty()
|
||||
}
|
||||
|
||||
/// A single source in the [`SourceMap`].
|
||||
pub struct SourceFile {
|
||||
/// The name of the file that the source came from.
|
||||
pub name: FileName,
|
||||
/// The complete source code.
|
||||
pub src: String,
|
||||
/// The start position of this source in the `SourceMap`.
|
||||
pub start_pos: BytePos,
|
||||
/// The end position of this source in the `SourceMap`.
|
||||
pub end_pos: BytePos,
|
||||
/// Locations of line beginnings in the source code.
|
||||
lines: Vec<BytePos>,
|
||||
/// Locations of multi-byte characters in the source code.
|
||||
multibyte_chars: Vec<MultiByteChar>,
|
||||
}
|
||||
|
||||
impl SourceFile {
|
||||
/// Creates a new `SourceMap` given the file `name`,
|
||||
/// source contents, and the `start_pos`ition.
|
||||
///
|
||||
/// This position is used for analysis purposes.
|
||||
fn new(name: FileName, mut src: String, start_pos: BytePos) -> Self {
|
||||
normalize_src(&mut src);
|
||||
let end_pos = start_pos + BytePos::from_usize(src.len());
|
||||
let (lines, multibyte_chars) = analyze_source_file(&src, start_pos);
|
||||
Self {
|
||||
name,
|
||||
src,
|
||||
start_pos,
|
||||
end_pos,
|
||||
lines,
|
||||
multibyte_chars,
|
||||
}
|
||||
}
|
||||
|
||||
/// Converts an absolute `BytePos` to a `CharPos` relative to the `SourceFile`.
|
||||
fn bytepos_to_file_charpos(&self, bpos: BytePos) -> CharPos {
|
||||
// The number of extra bytes due to multibyte chars in the `SourceFile`.
|
||||
let mut total_extra_bytes = 0;
|
||||
|
||||
for mbc in self.multibyte_chars.iter() {
|
||||
if mbc.pos < bpos {
|
||||
// Every character is at least one byte, so we only
|
||||
// count the actual extra bytes.
|
||||
total_extra_bytes += mbc.bytes as u32 - 1;
|
||||
// We should never see a byte position in the middle of a
|
||||
// character.
|
||||
assert!(bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert!(self.start_pos.to_u32() + total_extra_bytes <= bpos.to_u32());
|
||||
CharPos(bpos.to_usize() - self.start_pos.to_usize() - total_extra_bytes as usize)
|
||||
}
|
||||
|
||||
/// Finds the line containing the given position. The return value is the
|
||||
/// index into the `lines` array of this `SourceFile`, not the 1-based line
|
||||
/// number. If the source_file is empty or the position is located before the
|
||||
/// first line, `None` is returned.
|
||||
fn lookup_line(&self, pos: BytePos) -> Option<usize> {
|
||||
match self.lines.binary_search(&pos) {
|
||||
Ok(idx) => Some(idx),
|
||||
Err(0) => None,
|
||||
Err(idx) => Some(idx - 1),
|
||||
}
|
||||
}
|
||||
|
||||
/// Looks up the file's (1-based) line number and (0-based `CharPos`) column offset, for a
|
||||
/// given `BytePos`.
|
||||
fn lookup_file_pos(&self, pos: BytePos) -> (usize, CharPos) {
|
||||
let chpos = self.bytepos_to_file_charpos(pos);
|
||||
match self.lookup_line(pos) {
|
||||
Some(a) => {
|
||||
let line = a + 1; // Line numbers start at 1
|
||||
let linebpos = self.lines[a];
|
||||
let linechpos = self.bytepos_to_file_charpos(linebpos);
|
||||
let col = chpos - linechpos;
|
||||
assert!(chpos >= linechpos);
|
||||
(line, col)
|
||||
}
|
||||
None => (0, chpos),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns contents of a `span` assumed to be within the given file.
|
||||
fn contents_of_span(&self, span: Span) -> String {
|
||||
let begin_pos = self.bytepos_to_file_charpos(span.lo).to_usize();
|
||||
let end_pos = self.bytepos_to_file_charpos(span.hi).to_usize();
|
||||
String::from_utf8_lossy(&self.src.as_bytes()[begin_pos..end_pos]).into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
/// Detailed information on a `Span`.
|
||||
pub struct SpanLocation {
|
||||
pub source_file: Rc<SourceFile>,
|
||||
pub line_start: usize,
|
||||
pub line_stop: usize,
|
||||
pub col_start: usize,
|
||||
pub col_stop: usize,
|
||||
}
|
||||
|
||||
impl SpanLocation {
|
||||
/// Returns a dummy location.
|
||||
pub fn dummy() -> Self {
|
||||
let dummy = "<dummy>".to_owned();
|
||||
let span = Span::dummy();
|
||||
Self {
|
||||
source_file: Rc::new(SourceFile {
|
||||
name: FileName::Custom(dummy.clone()),
|
||||
src: dummy,
|
||||
start_pos: span.lo,
|
||||
end_pos: span.hi,
|
||||
lines: Vec::new(),
|
||||
multibyte_chars: Vec::new(),
|
||||
}),
|
||||
line_start: 0,
|
||||
line_stop: 0,
|
||||
col_start: 0,
|
||||
col_stop: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// File / Line / Column information on a `BytePos`.
|
||||
pub struct LineCol {
|
||||
/// Information on the original source.
|
||||
pub source_file: Rc<SourceFile>,
|
||||
/// The 1-based line number.
|
||||
pub line: usize,
|
||||
/// The (0-based) column offset into the line.
|
||||
pub col: CharPos,
|
||||
}
|
||||
|
||||
/// Normalizes the source code and records the normalizations.
|
||||
fn normalize_src(src: &mut String) {
|
||||
remove_bom(src);
|
||||
normalize_newlines(src);
|
||||
}
|
||||
|
||||
/// Removes UTF-8 BOM, if any.
|
||||
fn remove_bom(src: &mut String) {
|
||||
if src.starts_with('\u{feff}') {
|
||||
src.drain(..3);
|
||||
}
|
||||
}
|
||||
|
||||
/// Replaces `\r\n` with `\n` in-place in `src`.
|
||||
///
|
||||
/// Returns error if there's a lone `\r` in the string.
|
||||
fn normalize_newlines(src: &mut String) {
|
||||
if !src.as_bytes().contains(&b'\r') {
|
||||
return;
|
||||
}
|
||||
|
||||
// We replace `\r\n` with `\n` in-place, which doesn't break utf-8 encoding.
|
||||
// While we *can* call `as_mut_vec` and do surgery on the live string
|
||||
// directly, let's rather steal the contents of `src`. This makes the code
|
||||
// safe even if a panic occurs.
|
||||
|
||||
let mut buf = std::mem::replace(src, String::new()).into_bytes();
|
||||
let mut gap_len = 0;
|
||||
let mut tail = buf.as_mut_slice();
|
||||
loop {
|
||||
let idx = match find_crlf(&tail[gap_len..]) {
|
||||
None => tail.len(),
|
||||
Some(idx) => idx + gap_len,
|
||||
};
|
||||
tail.copy_within(gap_len..idx, 0);
|
||||
tail = &mut tail[idx - gap_len..];
|
||||
if tail.len() == gap_len {
|
||||
break;
|
||||
}
|
||||
gap_len += 1;
|
||||
}
|
||||
|
||||
// Account for removed `\r`.
|
||||
// After `set_len`, `buf` is guaranteed to contain utf-8 again.
|
||||
let new_len = buf.len() - gap_len;
|
||||
unsafe {
|
||||
buf.set_len(new_len);
|
||||
*src = String::from_utf8_unchecked(buf);
|
||||
}
|
||||
|
||||
fn find_crlf(src: &[u8]) -> Option<usize> {
|
||||
let mut search_idx = 0;
|
||||
while let Some(idx) = find_cr(&src[search_idx..]) {
|
||||
if src[search_idx..].get(idx + 1) != Some(&b'\n') {
|
||||
search_idx += idx + 1;
|
||||
continue;
|
||||
}
|
||||
return Some(search_idx + idx);
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn find_cr(src: &[u8]) -> Option<usize> {
|
||||
src.iter().position(|&b| b == b'\r')
|
||||
}
|
||||
}
|
||||
|
||||
/// Identifies an offset of a multi-byte character in a `SourceFile`.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
|
||||
struct MultiByteChar {
|
||||
/// The absolute offset of the character in the `SourceMap`.
|
||||
pub pos: BytePos,
|
||||
/// The number of bytes, `>= 2`.
|
||||
pub bytes: u8,
|
||||
}
|
||||
|
||||
/// Finds all newlines, multi-byte characters, and non-narrow characters in a
|
||||
/// SourceFile.
|
||||
///
|
||||
/// This function will use an SSE2 enhanced implementation if hardware support
|
||||
/// is detected at runtime.
|
||||
fn analyze_source_file(src: &str, source_file_start_pos: BytePos) -> (Vec<BytePos>, Vec<MultiByteChar>) {
|
||||
let mut lines = vec![source_file_start_pos];
|
||||
let mut multi_byte_chars = vec![];
|
||||
|
||||
let mut i = 0;
|
||||
let src_bytes = src.as_bytes();
|
||||
|
||||
while i < src.len() {
|
||||
// SAFETY: We verified that i < src.len().
|
||||
let i_usize = i as usize;
|
||||
let byte = unsafe { *src_bytes.get_unchecked(i_usize) };
|
||||
|
||||
// How much to advance to get to the next UTF-8 char in the string.
|
||||
let mut char_len = 1;
|
||||
|
||||
let pos = BytePos::from_usize(i) + source_file_start_pos;
|
||||
|
||||
if let b'\n' = byte {
|
||||
lines.push(pos + BytePos(1));
|
||||
} else if byte >= 127 {
|
||||
// The slow path:
|
||||
// This is either ASCII control character "DEL" or the beginning of
|
||||
// a multibyte char. Just decode to `char`.
|
||||
let c = (&src[i..]).chars().next().unwrap();
|
||||
char_len = c.len_utf8();
|
||||
|
||||
if char_len > 1 {
|
||||
assert!((2..=4).contains(&char_len));
|
||||
let bytes = char_len as u8;
|
||||
let mbc = MultiByteChar { pos, bytes };
|
||||
multi_byte_chars.push(mbc);
|
||||
}
|
||||
}
|
||||
|
||||
i += char_len;
|
||||
}
|
||||
|
||||
// The code above optimistically registers a new line *after* each \n it encounters.
|
||||
// If that point is already outside the source_file, remove it again.
|
||||
if let Some(&last_line_start) = lines.last() {
|
||||
let source_file_end = source_file_start_pos + BytePos::from_usize(src.len());
|
||||
assert!(source_file_end >= last_line_start);
|
||||
if last_line_start == source_file_end {
|
||||
lines.pop();
|
||||
}
|
||||
}
|
||||
|
||||
(lines, multi_byte_chars)
|
||||
}
|
@ -16,103 +16,44 @@
|
||||
|
||||
//! Defines the `Span` type used to track where code comes from.
|
||||
|
||||
use std::{fmt, sync::Arc, usize};
|
||||
use core::ops::{Add, Sub};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{fmt, usize};
|
||||
|
||||
use serde::ser::{Serialize, SerializeStruct, Serializer};
|
||||
use serde::Deserialize;
|
||||
use crate::symbol::with_session_globals;
|
||||
|
||||
/// The span type which tracks where formatted errors originate from in a Leo file.
|
||||
/// This is used in many spots throughout the rest of the Leo crates.
|
||||
#[derive(Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub struct Span {
|
||||
// TODO(Centril): All of could be optimized to just `{ lo: u32, hi: u32 }`,
|
||||
// i.e. 8 bytes by indexing into a global source map of all files concatenated.
|
||||
// That would also give us `Copy` which is quite nice!
|
||||
/// The line number where the error started.
|
||||
pub line_start: usize,
|
||||
/// The line number where the error stopped.
|
||||
pub line_stop: usize,
|
||||
/// The column number where the error started.
|
||||
pub col_start: usize,
|
||||
/// The column number where the error stopped.
|
||||
pub col_stop: usize,
|
||||
/// The path to the Leo file containing the error.
|
||||
pub path: Arc<String>,
|
||||
/// The content of the line(s) that the span is found on.
|
||||
pub content: String,
|
||||
/// The start position of the span.
|
||||
pub lo: BytePos,
|
||||
/// The end position of the span.
|
||||
/// The length is simply `end - start`.
|
||||
pub hi: BytePos,
|
||||
}
|
||||
|
||||
impl Span {
|
||||
/// Generate a new span from:
|
||||
/// - Where the Leo line starts.
|
||||
/// - Where the Leo line stops.
|
||||
/// - Where the Leo column starts.
|
||||
/// - Where the Leo column stops.
|
||||
/// - The path to the Leo file.
|
||||
/// - The content of those specified bounds.
|
||||
pub fn new(
|
||||
line_start: usize,
|
||||
line_stop: usize,
|
||||
col_start: usize,
|
||||
col_stop: usize,
|
||||
path: Arc<String>,
|
||||
content: String,
|
||||
) -> Self {
|
||||
Self {
|
||||
line_start,
|
||||
line_stop,
|
||||
col_start,
|
||||
col_stop,
|
||||
path,
|
||||
content,
|
||||
}
|
||||
/// Generate a new span from the `start`ing and `end`ing positions.
|
||||
pub fn new(start: BytePos, end: BytePos) -> Self {
|
||||
Self { lo: start, hi: end }
|
||||
}
|
||||
|
||||
/// Generates a dummy span with all defaults.
|
||||
/// Should only be used in temporary situations.
|
||||
pub fn dummy() -> Self {
|
||||
Self::new(0, 0, 0, 0, <_>::default(), <_>::default())
|
||||
Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for Span {
|
||||
/// Custom serialization for testing purposes.
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
let mut state = serializer.serialize_struct("Color", 3)?;
|
||||
state.serialize_field("line_start", &self.line_start)?;
|
||||
state.serialize_field("line_stop", &self.line_stop)?;
|
||||
state.serialize_field("col_start", &self.col_start)?;
|
||||
state.serialize_field("col_stop", &self.col_stop)?;
|
||||
// This is for testing purposes since the tests are run on a variety of OSes.
|
||||
if std::env::var("LEO_TESTFRAMEWORK")
|
||||
.unwrap_or_default()
|
||||
.trim()
|
||||
.to_owned()
|
||||
.is_empty()
|
||||
{
|
||||
state.serialize_field("path", &self.path)?;
|
||||
} else {
|
||||
state.serialize_field("path", "")?;
|
||||
}
|
||||
state.serialize_field("content", &self.content)?;
|
||||
state.end()
|
||||
/// Is the span a dummy?
|
||||
pub fn is_dummy(&self) -> bool {
|
||||
self == &Self::dummy()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Span {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if self.line_start == self.line_stop {
|
||||
write!(f, "{}:{}-{}", self.line_start, self.col_start, self.col_stop)
|
||||
} else {
|
||||
write!(
|
||||
f,
|
||||
"{}:{}-{}:{}",
|
||||
self.line_start, self.col_start, self.line_stop, self.col_stop
|
||||
)
|
||||
}
|
||||
with_session_globals(|s| write!(f, "{}", s.source_map.span_to_string(*self)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,62 +68,88 @@ impl std::ops::Add for &Span {
|
||||
impl std::ops::Add for Span {
|
||||
type Output = Self;
|
||||
|
||||
#[allow(clippy::comparison_chain)]
|
||||
fn add(self, other: Self) -> Self {
|
||||
if self.line_start == other.line_stop {
|
||||
Span {
|
||||
line_start: self.line_start,
|
||||
line_stop: self.line_stop,
|
||||
col_start: self.col_start.min(other.col_start),
|
||||
col_stop: self.col_stop.max(other.col_stop),
|
||||
path: self.path,
|
||||
content: self.content,
|
||||
}
|
||||
} else {
|
||||
let mut new_content = vec![];
|
||||
let self_lines = self.content.lines().collect::<Vec<_>>();
|
||||
let other_lines = other.content.lines().collect::<Vec<_>>();
|
||||
for line in self.line_start.min(other.line_start)..self.line_stop.max(other.line_stop) + 1 {
|
||||
if line >= self.line_start && line <= self.line_stop {
|
||||
new_content.push(
|
||||
self_lines
|
||||
.get(line - self.line_start)
|
||||
.copied()
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
);
|
||||
} else if line >= other.line_start && line <= other.line_stop {
|
||||
new_content.push(
|
||||
other_lines
|
||||
.get(line - other.line_start)
|
||||
.copied()
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
);
|
||||
} else if new_content.last().map(|x| *x != "...").unwrap_or(true) {
|
||||
new_content.push(format!("{:<1$}...", " ", other.col_start + 4));
|
||||
}
|
||||
}
|
||||
let new_content = new_content.join("\n");
|
||||
if self.line_start < other.line_stop {
|
||||
Span {
|
||||
line_start: self.line_start,
|
||||
line_stop: other.line_stop,
|
||||
col_start: self.col_start,
|
||||
col_stop: other.col_stop,
|
||||
path: self.path,
|
||||
content: new_content,
|
||||
}
|
||||
} else {
|
||||
Span {
|
||||
line_start: other.line_start,
|
||||
line_stop: self.line_stop,
|
||||
col_start: other.col_start,
|
||||
col_stop: self.col_stop,
|
||||
path: self.path,
|
||||
content: new_content,
|
||||
}
|
||||
}
|
||||
}
|
||||
let lo = self.lo.min(other.lo);
|
||||
let hi = self.hi.max(other.hi);
|
||||
Self::new(lo, hi)
|
||||
}
|
||||
}
|
||||
|
||||
// _____________________________________________________________________________
|
||||
// Pos, BytePos, CharPos
|
||||
//
|
||||
|
||||
pub trait Pos {
|
||||
fn from_usize(n: usize) -> Self;
|
||||
fn to_usize(&self) -> usize;
|
||||
fn from_u32(n: u32) -> Self;
|
||||
fn to_u32(&self) -> u32;
|
||||
}
|
||||
|
||||
macro_rules! impl_pos {
|
||||
(
|
||||
$(
|
||||
$(#[$attr:meta])*
|
||||
$vis:vis struct $ident:ident($inner_vis:vis $inner_ty:ty);
|
||||
)*
|
||||
) => {
|
||||
$(
|
||||
$(#[$attr])*
|
||||
$vis struct $ident($inner_vis $inner_ty);
|
||||
|
||||
impl Pos for $ident {
|
||||
#[inline(always)]
|
||||
fn from_usize(n: usize) -> $ident {
|
||||
$ident(n as $inner_ty)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn to_usize(&self) -> usize {
|
||||
self.0 as usize
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn from_u32(n: u32) -> $ident {
|
||||
$ident(n as $inner_ty)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn to_u32(&self) -> u32 {
|
||||
self.0 as u32
|
||||
}
|
||||
}
|
||||
|
||||
impl Add for $ident {
|
||||
type Output = $ident;
|
||||
|
||||
#[inline(always)]
|
||||
fn add(self, rhs: $ident) -> $ident {
|
||||
$ident(self.0 + rhs.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl Sub for $ident {
|
||||
type Output = $ident;
|
||||
|
||||
#[inline(always)]
|
||||
fn sub(self, rhs: $ident) -> $ident {
|
||||
$ident(self.0 - rhs.0)
|
||||
}
|
||||
}
|
||||
)*
|
||||
};
|
||||
}
|
||||
|
||||
impl_pos! {
|
||||
/// A byte offset.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize, Default)]
|
||||
pub struct BytePos(pub u32);
|
||||
|
||||
/// A character offset.
|
||||
///
|
||||
/// Because of multibyte UTF-8 characters,
|
||||
/// a byte offset is not equivalent to a character offset.
|
||||
/// The [`SourceMap`] will convert [`BytePos`] values to `CharPos` values as necessary.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
|
||||
pub struct CharPos(pub usize);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::dropless::DroplessArena;
|
||||
use crate::source_map::SourceMap;
|
||||
|
||||
use core::cmp::PartialEq;
|
||||
use core::convert::AsRef;
|
||||
@ -287,12 +288,15 @@ impl fmt::Display for SymbolStr {
|
||||
pub struct SessionGlobals {
|
||||
/// The interner for `Symbol`s used in the compiler.
|
||||
symbol_interner: Interner,
|
||||
/// The source map used in the compiler.
|
||||
pub source_map: SourceMap,
|
||||
}
|
||||
|
||||
impl SessionGlobals {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
symbol_interner: Interner::prefilled(),
|
||||
source_map: SourceMap::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: bbe973798ab14152165455260924a0de60131d31da32d2e223228954365dc609
|
||||
initial_ast: fa5f2ab70ae04bbd7684fc630de6cd5d6d85e791ccf9f06e65b7ae6a03e2ec48
|
||||
- initial_input_ast: c7315faf1ac3ceeb90260e64e4a411a27a8aa732892a64c15f49e81adf464beb
|
||||
initial_ast: b80eed2960509f11bce6294687558fb7b907f1d83455287f944dfa981ebe1ec8
|
||||
symbol_table: 9d42b1d8f167826635e5169bc3a50c14f722fba8e5ce2480fbde3b8cf2e75237
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 98da6a76f2370e9311042851dde02ebaa4e64528d9461a5e722858f394d25f93
|
||||
- initial_input_ast: 85307a4f16278d38b746d321756e41c3cf48bbb2dc5bad2f0e9a7b8c4dd2541e
|
||||
initial_ast: 998b6e02af1be3c649cecd0129810b237f33289b801d24a90c38260561cc0318
|
||||
- initial_input_ast: dc6b4b00185dd6c1f2b83a1bfae619c1d6e3f68ac0f1d3d87ae3bd0ed5caf083
|
||||
- initial_input_ast: 73a38568160c3d2be402043d04ccdc2290abe27647bc81c4bd50367834c206cf
|
||||
initial_ast: 6514080a9452d6e193510250dec3b87081e0741d05cc59ca456f2b2f3f36ec72
|
||||
symbol_table: 7ec407fabcae0eeef889009b8ba99beac3d18b2d79cc49e7760261d80bd59728
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 98da6a76f2370e9311042851dde02ebaa4e64528d9461a5e722858f394d25f93
|
||||
- initial_input_ast: 85307a4f16278d38b746d321756e41c3cf48bbb2dc5bad2f0e9a7b8c4dd2541e
|
||||
initial_ast: c1865cfe898ea72b3f411b63364f3643ad452860c6d1db92e843f2c61094eec9
|
||||
- initial_input_ast: b6371958e735320861c84ed514f258ae8a9858b34615364b2f9ebbaa2aaadd8c
|
||||
- initial_input_ast: d384cfea1a36220e9ea4e246ece89d8fffa320f90aeeb85660bc445ab62a0829
|
||||
initial_ast: 7085f8bf0a01a4fd7b73b5e3fc1c2c812d0cd459a5b6ea85791fc3c01118c7a0
|
||||
symbol_table: 5a12f141aef86a7a00b86650e23cfd9af657d6f418df7b1ee9eab06714305d31
|
||||
|
@ -3,9 +3,9 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0
|
||||
- initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66
|
||||
- initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4
|
||||
- initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d
|
||||
initial_ast: 30050aaa080b73f03ccc9a5fda9bdb9fcba0aea90171b8cdf39c50c5eb8ac7ab
|
||||
- initial_input_ast: e6457724e4c3bb27eca30df861f711f962ac47fb0e7d0b9dc959be0feaeb7763
|
||||
- initial_input_ast: c8d27a86795a6d56815a681066b7f462f5476be6d56ec910b74d90c60d8b3cc9
|
||||
- initial_input_ast: 4ff2fb01e2d10a59bf4fcd1ed3b510c6860167dbd3bd4d099c6b8a78d2a767af
|
||||
- initial_input_ast: 96ddbb84cba723df65571d6537a303189e6274389593980996fd7ee50eab996e
|
||||
initial_ast: e17f5c2d253ffc1e8e3389253f89feca418b429eb912840a21172d63d117c7ec
|
||||
symbol_table: f36863240edb9fb5fb852c212a9ae1db491ee8243d0469fc155592964595e7d0
|
||||
|
@ -3,9 +3,9 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0
|
||||
- initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66
|
||||
- initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4
|
||||
- initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d
|
||||
initial_ast: 73e2d3f95cac34a231f20df1de3c53fd08ae3d9e604ee28557c1098299e8170c
|
||||
- initial_input_ast: e7e9fd77647ac56ed68e547bfb8d0c767313030072a510ec138027ffb62fc368
|
||||
- initial_input_ast: e43c024d6fad8a7a04672fa318936703a4798699283f7b66d9383d52acc104a0
|
||||
- initial_input_ast: 695d879ad212b23fb3e91fae782c701c5f0469bbcaabdcfc6e5dcadc5b7e6c9a
|
||||
- initial_input_ast: 390e951d2b90cf150acd9bc6eeeffbc3a8d7af3ce3781f14ebdce3f1054de4c8
|
||||
initial_ast: adb3d21c4da2e7538a95ba689373f870d370001c8fb60e38a96ed6e6cf87ae6c
|
||||
symbol_table: 4fd4e476609947028fbffe357ffb9d962e96c30a9abe3677d75675ae37b12587
|
||||
|
@ -3,9 +3,9 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0
|
||||
- initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66
|
||||
- initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4
|
||||
- initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d
|
||||
initial_ast: 3c8d1d820525dc4e77214dfa0628a8fb73890ee1b90cfd443a4a736e6506bbad
|
||||
- initial_input_ast: e6457724e4c3bb27eca30df861f711f962ac47fb0e7d0b9dc959be0feaeb7763
|
||||
- initial_input_ast: c8d27a86795a6d56815a681066b7f462f5476be6d56ec910b74d90c60d8b3cc9
|
||||
- initial_input_ast: 4ff2fb01e2d10a59bf4fcd1ed3b510c6860167dbd3bd4d099c6b8a78d2a767af
|
||||
- initial_input_ast: 96ddbb84cba723df65571d6537a303189e6274389593980996fd7ee50eab996e
|
||||
initial_ast: 487ec91d706447fafcff6e448723fa41dd02e6d8ea1b3b8670460ef9a7931c90
|
||||
symbol_table: c8dd46774e298ef70fc87f89ecb8b5f23f63b1f2401f337fc97ad83b54e85871
|
||||
|
@ -3,9 +3,9 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0
|
||||
- initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66
|
||||
- initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4
|
||||
- initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d
|
||||
initial_ast: f94ce8212b4164b85de34920f7da472033fbafe03e8e1d00a0ec7f9bae692b6c
|
||||
- initial_input_ast: e6457724e4c3bb27eca30df861f711f962ac47fb0e7d0b9dc959be0feaeb7763
|
||||
- initial_input_ast: c8d27a86795a6d56815a681066b7f462f5476be6d56ec910b74d90c60d8b3cc9
|
||||
- initial_input_ast: 4ff2fb01e2d10a59bf4fcd1ed3b510c6860167dbd3bd4d099c6b8a78d2a767af
|
||||
- initial_input_ast: 96ddbb84cba723df65571d6537a303189e6274389593980996fd7ee50eab996e
|
||||
initial_ast: 4c24b2ad645f55d42b011b1173fc756330dfa1df4734c2c3275ff53a364ba28c
|
||||
symbol_table: 8ed9a73e996562abfe75837cfbf2103a4d9213291298206f4f63a7dac808cbc1
|
||||
|
@ -3,9 +3,9 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0
|
||||
- initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66
|
||||
- initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4
|
||||
- initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d
|
||||
initial_ast: ceac1c88ce7915eb171fef59cf7788b1d83cb53d313e0325b4b6e7ca7c0b0eea
|
||||
- initial_input_ast: e6457724e4c3bb27eca30df861f711f962ac47fb0e7d0b9dc959be0feaeb7763
|
||||
- initial_input_ast: c8d27a86795a6d56815a681066b7f462f5476be6d56ec910b74d90c60d8b3cc9
|
||||
- initial_input_ast: 4ff2fb01e2d10a59bf4fcd1ed3b510c6860167dbd3bd4d099c6b8a78d2a767af
|
||||
- initial_input_ast: 96ddbb84cba723df65571d6537a303189e6274389593980996fd7ee50eab996e
|
||||
initial_ast: 69f7732147079d749ad863cb4442be4722f1b7eb16f26b7f972beed0d006044c
|
||||
symbol_table: 91630eda77eaf1e355744e663ceba26a0c3f860d3f69e8e46b03f5464d16950f
|
||||
|
@ -3,20 +3,20 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: cd2c41435af95147ff1dcd94031e443b93b15ac7b4f65331ef734759006f3c03
|
||||
- initial_input_ast: 5e4fd7cfc681e863ed393f7746308d7b962e2b5f9dcd21aa09a26526ce2ea8e3
|
||||
- initial_input_ast: 8fcda0e92250e9897bdb8cfb9b1e3046f94f6f6206ecb958d9758e64e5615889
|
||||
- initial_input_ast: 41fef97affd26b29428302f519a5e7a7d61158923e6576618c42607f0c16ff4f
|
||||
- initial_input_ast: 30c56d9a2e096215900942f18b63cf5a96fb9c0b7cf4fea11dafeeabb02a5233
|
||||
- initial_input_ast: 076d0f1b70534c15108ea0dc9e74860030d6701ce1ce38b4a3a41e5ba9fe0121
|
||||
- initial_input_ast: d3bff6374e68b63bf35fe089bbff0abb31958571b99b9e0251d82895fdc27edd
|
||||
- initial_input_ast: 9455652735eb74bd67423f9ed2c7d76b1b27e47f62b5331843f8f4975a03cc9a
|
||||
- initial_input_ast: 3f69c5fdd03605808dfb6ae116cdf860525b494d5d7cac39b667931c282e8c3e
|
||||
- initial_input_ast: bdc202a836d17bcb974e33b5b938148c0c9b57fd8b779e813c26d8feac915547
|
||||
- initial_input_ast: 6e12715d32233251ea63ae7457c7c1d20e82995cf3df02a1adb943ee358a2643
|
||||
- initial_input_ast: 6383f20ea72b337521956a9d86608fc1861f8a5e709bb29e88f2022e893d4e59
|
||||
- initial_input_ast: e4ba1106bf3425f620578111bd3c63c0178dbc087ab4c90e873c5b9cc790f6bc
|
||||
- initial_input_ast: 4c7f9b03dd308ff3981127c4c12adcb883fd8b3ce1dbd744cd935750961fc1c4
|
||||
- initial_input_ast: 2a5e92af845c8a56375cbc6123e92aa87cf4523e059c02dfcde326970d88f5c2
|
||||
initial_ast: 9733a36e7d3465c6217ecf2139c2e4154790e39f006f1e3318a981265d24ad23
|
||||
- initial_input_ast: 1a59d72ff9c08c97f0faa7d32e701487abce48630c3da2ec76dee451ed806c3b
|
||||
- initial_input_ast: 8c79c9fa5fa8422d837bd092a848293d1772fdc97b80c7394146fc759768c868
|
||||
- initial_input_ast: cbf3cfc28c6c396dd5dd24ec3cb59121d2d6615feb4aa9a452ea310248dfb238
|
||||
- initial_input_ast: 8a914ea590d1b978e7f0da8feeebcbe195e925a20424fe0a6611b2115b072c90
|
||||
- initial_input_ast: f37e2792fd64626a0270041c37d587d4929ac2afe6b3b9a576c3ec400271f0db
|
||||
- initial_input_ast: d9a2bd44fa3b8e850b79be10ab046af8d61b5e781cc991250969555eaccf9d23
|
||||
- initial_input_ast: c10a3ffcb8bbbaaa3028e8037fc183214933291d5ecf8ec0354df1b27a83c99a
|
||||
- initial_input_ast: 32628105ebaaed3207a26402f2f7a5075f2d7d865d51e56f2e8f0bade905058c
|
||||
- initial_input_ast: 2bc88f79d4b48e6321c08ba4a6cfeb2a7363b238d79b3a558dbc4383c14a3ebc
|
||||
- initial_input_ast: 5d6794f9c9406df4df4673433c806588bb9ed72992bb58cc62fa63a3a872e153
|
||||
- initial_input_ast: 833c67bb4946711a01be5f564905d83eaf4c4fbc72ff77599ff3b8dd5a5c8691
|
||||
- initial_input_ast: 2a4441d425a2e35c929d92256601e3713c870ef3c9c6206dccb238e42be532cb
|
||||
- initial_input_ast: 3edf030ed195c3ab8278af07fa1592314e2e3f9ad1e6c0ca3e27856be5e6f72c
|
||||
- initial_input_ast: f3dcb662ae0facb7afdd7cee9416261a48d37baa8a4d5d7f09d81e4621b53f3f
|
||||
- initial_input_ast: aebc549a2d2d87e1cca5e6d814b1b6dfdc4c32bb21045ad967bc67978a8ef871
|
||||
initial_ast: 8c9ec5e2c1544bc45c6d4dd9f21caa3121c2ba61c44fb66d8148883460b20820
|
||||
symbol_table: cf3569155d9961e6cab441ea9a60f5c92d2b18e6cd2ecaa64b1529d1774d3585
|
||||
|
@ -3,20 +3,20 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: cd2c41435af95147ff1dcd94031e443b93b15ac7b4f65331ef734759006f3c03
|
||||
- initial_input_ast: 5e4fd7cfc681e863ed393f7746308d7b962e2b5f9dcd21aa09a26526ce2ea8e3
|
||||
- initial_input_ast: 8fcda0e92250e9897bdb8cfb9b1e3046f94f6f6206ecb958d9758e64e5615889
|
||||
- initial_input_ast: 41fef97affd26b29428302f519a5e7a7d61158923e6576618c42607f0c16ff4f
|
||||
- initial_input_ast: 30c56d9a2e096215900942f18b63cf5a96fb9c0b7cf4fea11dafeeabb02a5233
|
||||
- initial_input_ast: 076d0f1b70534c15108ea0dc9e74860030d6701ce1ce38b4a3a41e5ba9fe0121
|
||||
- initial_input_ast: d3bff6374e68b63bf35fe089bbff0abb31958571b99b9e0251d82895fdc27edd
|
||||
- initial_input_ast: 9455652735eb74bd67423f9ed2c7d76b1b27e47f62b5331843f8f4975a03cc9a
|
||||
- initial_input_ast: 3f69c5fdd03605808dfb6ae116cdf860525b494d5d7cac39b667931c282e8c3e
|
||||
- initial_input_ast: bdc202a836d17bcb974e33b5b938148c0c9b57fd8b779e813c26d8feac915547
|
||||
- initial_input_ast: 6e12715d32233251ea63ae7457c7c1d20e82995cf3df02a1adb943ee358a2643
|
||||
- initial_input_ast: 6383f20ea72b337521956a9d86608fc1861f8a5e709bb29e88f2022e893d4e59
|
||||
- initial_input_ast: e4ba1106bf3425f620578111bd3c63c0178dbc087ab4c90e873c5b9cc790f6bc
|
||||
- initial_input_ast: 4c7f9b03dd308ff3981127c4c12adcb883fd8b3ce1dbd744cd935750961fc1c4
|
||||
- initial_input_ast: 2a5e92af845c8a56375cbc6123e92aa87cf4523e059c02dfcde326970d88f5c2
|
||||
initial_ast: 890e5d07cf4b2967be0e2f9c82268619015dc3cea62cc1520f406107cdd056e5
|
||||
- initial_input_ast: 44e0b05b0da70ab554408e1fa7a8578282522b358320cde13231c2136e4df5b1
|
||||
- initial_input_ast: fa8ef1a0d3743224c55ca78079611c87374266313d2254c5b18a99443e038d51
|
||||
- initial_input_ast: 6aa65f48c47c0a70326ee6034a46c38ed25116b02b748827fde3a4a46cb9cb95
|
||||
- initial_input_ast: de106cf7de15ce9b35d00a97dccf6b90077303e8bfcec568d65352107c2a81f8
|
||||
- initial_input_ast: a6badf7eba50a21d6ebc1c82eb70cd4081e37680dd8d4b597ea04192ccbf4e5a
|
||||
- initial_input_ast: 72e2f6ef3f3cb3135dbb46dd1c5808c206cfa762a708a8d5483b6bc2958a33ba
|
||||
- initial_input_ast: 0a5209868d802596f6094912deb7adaef5f21e0ee269eeaa3a661d403a64701e
|
||||
- initial_input_ast: be71fcee4adbb8c7de279825c5fd87d8c55597a97f57f9af28d88e3f51781c79
|
||||
- initial_input_ast: 55aae45600898144d628c1211e2de07794ce4784eef21a6b978aa064d3fa89f4
|
||||
- initial_input_ast: 8f73004838aee69e847d99ab0b284d99c61a8283b91227e1dd890994220da8e1
|
||||
- initial_input_ast: 6de398471c245e863855e68b0b672bcda53467f638ccf2ded60930a930f3de25
|
||||
- initial_input_ast: 1d22c4edd4f3fec707b8cb6e60bf57b4e278913fbb6c15c4fa2bce0e318de232
|
||||
- initial_input_ast: 7642187a32f44ae4d5743ae8f46bb669937490ff926c46cf8af8b36b5bc747c5
|
||||
- initial_input_ast: 4d7b20c6c94064e08e0f19b0f45cbdd740f668fefcafd361865226c5af087440
|
||||
- initial_input_ast: 9de9e1877e523f5aa44d019bba11e7bb58ad1f9952aae3254908e8b151b3ae55
|
||||
initial_ast: 526f77f4386ed6b5dd40f7e352f48e43c04655123bf329dbed9f6dadd43a4963
|
||||
symbol_table: 1cad55eef598e4d05af7c5f88119636a2e6d23d81213bbaad908d66a32906780
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 204a90b23ba88927aabdc72aed02effa556d73742caf7d370527f79f0b30f621
|
||||
initial_ast: 10539810602f7b65e0ac424d7e92b4565c965fdbe139b267f5fd4aae4c67d470
|
||||
- initial_input_ast: 9698e866b0330be095c65ca93f17ed5fe3d31c61d5622eaf54c774d79d3b6950
|
||||
initial_ast: d771cc51e9c822faf8cb1ca6f80d19c22379ac37c9ae9e357010e79029c6baf2
|
||||
symbol_table: f8c971e501487f7a368a50fd1941c3fb70684b041478fe615a91f088796e301b
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 204a90b23ba88927aabdc72aed02effa556d73742caf7d370527f79f0b30f621
|
||||
- initial_input_ast: cbc36a842b21e80aee167b65bd1a59861d59a43e27915b785410f032ae19a570
|
||||
initial_ast: 1e37339f631e947b4f85cf4f43ba4c1a26439ab565dc559f27c4923afc3ef34a
|
||||
- initial_input_ast: e9253dc5764d8870dc6842860993ce0b2495925b3bdb18891b7c4aa67fe0a81d
|
||||
- initial_input_ast: 3153e33ab1630d74ad221b5ce6d5e50c17fb86d91a2aae4ce67b46fec12c1ef4
|
||||
initial_ast: 8fdb85c9c133687f89fe5c2ca9b177a4a777269eab425f9008ab330cce85542e
|
||||
symbol_table: f4e056be00b25dfd854a5be8197aeb205436bb0ee11cfe06701531ea086e038c
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031
|
||||
initial_ast: 379919a368ef91f880f8209c68891ac5b5071c3d7f64ae15b39eaab52972d6a9
|
||||
- initial_input_ast: 6b9e5227fdce9f916cd2398ea85c2d7e7b2f7d706bfa730b8cd1acdeb3f168cd
|
||||
initial_ast: e3b69d0b4355afd331edf8c572b64746bc763a714626043a9edc8eba42b08ec8
|
||||
symbol_table: d46f6eb98259f34d32a60788aa178efa34166bcc6ba1058e2ff5f8327a129b9c
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031
|
||||
initial_ast: c573c8914fc34302d6ea0ad1727f61b02c540f2f9dce82fd492407002516a367
|
||||
- initial_input_ast: 89959164cbf734ac0d261c7459b9c1214eb2f4b3ab9ec57a0b22db487d6537e4
|
||||
initial_ast: cb79b9db64a7e92b85706e517b586b4fe9cd591850e7130cc7bfad6dd92b4d3f
|
||||
symbol_table: 559484bc163178bf54b169f5dd573167771566aa993055b6a28f0c1a759339bc
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: b9ca1f9e4746ba9f99375205e309b977a522109054d058039197767b39fa6833
|
||||
- initial_input_ast: 398a847f3f6c8826a10942c856b67d9acf37a51bf4ec9109be549b24b2dfff94
|
||||
initial_ast: 29f607e8e1badfbb612a8acb20123882205c86c7290a24dca70df39f8261cc0b
|
||||
- initial_input_ast: 4132cf36ac66f6b23e249f81b5c2aafa58e4e5e945920cc29752edc5d6d8057f
|
||||
- initial_input_ast: 586ed72429932a1aafcd0f8eed983a4babff8eada9c028b88bbeef24dab1cbc0
|
||||
initial_ast: 0360f7fba87784c290f73693b81ca1b71e3259794f0fb3d3cbe39cc143e92d82
|
||||
symbol_table: 560afbb790df70bfc770d5c2f966428a37baf94a5c0f5312ad445456d33a2cd9
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031
|
||||
initial_ast: a5cf98065c1f1a668d898974ab67cd148e43409c0455d95f77e030cb5c905e0c
|
||||
- initial_input_ast: 5411bd17943bb0aa7b0bb27e8b38f57fd27f06f2080b13a32eee50c53de66f6c
|
||||
initial_ast: ab02de15b37b07d52d385468d72b03f8f9ecff3c9f130b8a3985be326f9f6edf
|
||||
symbol_table: 720c2aafae77c261ed1640d4080f9a73657638baa30e54a5e10e2323b6f6eca0
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031
|
||||
initial_ast: 1b5cb8e6d851548c2413ef9d0e90bc46b70ee109655c5396522ae06a73832015
|
||||
- initial_input_ast: 18e8a4118829470d3150268bbf8d298954e1f566ea2d42ed9f3660dc25c23fcc
|
||||
initial_ast: 4fa505d3542f2df2abcdbbf7d487ff65e1e311366fc2eaee286f8ba253876883
|
||||
symbol_table: e5159343ab03573032873783b28058a482dd401d534a0d3af03790a5286ba470
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031
|
||||
initial_ast: 620af027368aff6683ef9951f714867e1c53d335621b549978177c0951a67ecb
|
||||
- initial_input_ast: caa45de3b412d749048b9be732a4593f3094c671701093103f580817a741acbb
|
||||
initial_ast: 8dc13a9cb4d48b8a5e33d4e16a3071869a6ac7034962af5baf8f5f19a2b218dd
|
||||
symbol_table: 757bb967973b87466c01be1a9dc78d30701964e0d234e0e65d1bbcbd3072370f
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2
|
||||
initial_ast: ea05e8a68b86c5cd7189870b309bb5a4107dd6f84c9ccd359aacbfee82045242
|
||||
- initial_input_ast: 4a7171bfd4cb5b69729e26e4c6b0915f261d3f51b2937d8de5009069f56abfc1
|
||||
initial_ast: 8b6fdc73a1397af850bcb47a623f82ff773919308fec52eeb890c8b4a2e686e7
|
||||
symbol_table: 66779461e33acc9c5c732509637db91bd72aff3e9dae6aee0c137d0537446878
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: e0c7874ac5b43acb60bfb111cfafba0b5151b202f86c459913a9d4dd8ca151b0
|
||||
- initial_input_ast: 770cad45d17364fd3acd19fb67c66ea8f58ea54c5c42386d1a0fe02f241e9f2b
|
||||
initial_ast: 5c6f3087ccb1ce8c559638d4a4308a784a1a69735fd3a4cbd7eccdcb6b76aeb7
|
||||
symbol_table: d666098c1c0d7c670730cfa6548d47fa89d9a1dd33642f8021b0622f9abc0e5e
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 149443378c6b75f71b33ad90306cf4b01616284ddfa2136fc19fe41e23c73178
|
||||
- initial_input_ast: 3b1682d80f44da8eb1ea0d1236b5b9be15f7d4792fe7f31139a4362b2952d6a0
|
||||
initial_ast: cda0e01cadbcd6488f11d1a79fd9e4d132560ff75dad986cb4502d74f3e464be
|
||||
symbol_table: 38cbfecf35fb5189618a9767d3245d02e133d59ce2a0fc0f3aba37a8fa14fe8e
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 51eba8b00503b23218feec128cda498464acd2a9459fc717795d4137495a9820
|
||||
- initial_input_ast: 1d6d705c0d5363431af8b58173f1061d4315c4ffe9ae175d6dd1c7ea2a01488f
|
||||
initial_ast: fa376065aea93f4819afe923b978fd8addc4565c13b33cef8416cdd599f331b2
|
||||
symbol_table: 0879cd6e4cc609ecdbdfc87ff0f08b4f3ae54367e0a1c02116304eb1411d2c23
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: d8d9ee6d763397372e62451e15980cde07796859d8ce319e4de5955d310f0cf6
|
||||
- initial_input_ast: ccecfe74d5a1f89e892c982f5bf5bb59e094ade3b745b615ab1dcdc31b43dcd7
|
||||
initial_ast: 15c31493b92dfe33d788f1259cc4208e47b050ed23a78febaf1611a89bea18a1
|
||||
symbol_table: 879c99134415a9bae5a26b0d2dccfab01b9374218b810853c86bcf36a76d979c
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: d95922ca56dfdffdea1e8c9668d67b17755ca66ff1c5387f034ecfb2ba961df6
|
||||
- initial_input_ast: 770cad45d17364fd3acd19fb67c66ea8f58ea54c5c42386d1a0fe02f241e9f2b
|
||||
initial_ast: 85b903cc00f43ea3e7c890d66ac568daded94a6c215028ef28d454e42bd6a25a
|
||||
symbol_table: 47782aad84b54a835bead341b6113b471712ddd6d19005040d16c5d199a0920a
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 31535a250bbc7eaedc9a40720b2668544615862297f229f633f51b3311d0ac0e
|
||||
- initial_input_ast: a2440344211fa1dec9858bba8ae80c44b17dcf10d6d75bf639bd9019de97a843
|
||||
initial_ast: f0f1be1e9efbb5455c0188bb7e646379eb2094914382378767d90d2deecb533b
|
||||
symbol_table: e20aa1c0f5d1b64b310c0e6d6bb306713f8696f092d080eab4031eacc0dcb798
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 7b7c0226a27a7655fd6e4780fdfcf5d2bc923d2aa48585954b47b8cd852bc998
|
||||
- initial_input_ast: 195a6921720db473ae0b5093da0353391308e0e31a698e5ef105127e94113ff6
|
||||
initial_ast: 66e17dd0b33e9a4f2e4312c5d6605a5d63e5bdf537df5f08f1a2fdc30f24c3f5
|
||||
symbol_table: c04c06d2f689387637bac27fff30cdaa87ec9b49fc03e1fe56b1e04029b6f925
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 586028215ccf26abab187d6bff25c5dd332f1397be5474c468ca1411abec89a0
|
||||
- initial_input_ast: 195a6921720db473ae0b5093da0353391308e0e31a698e5ef105127e94113ff6
|
||||
initial_ast: b4e5d9d62d4ed1e5f963b0d957c9be73b8ebe09e749d1658396672ea7d938454
|
||||
symbol_table: 5527b2434b61b94d365ba1e8bd1c2173b9feef5aa21c99440920259fb7df2052
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: a9df57a8047f8562e1c08ac89cc25997590cb3759d7cc930714de57e8ac30624
|
||||
- initial_input_ast: 3b1682d80f44da8eb1ea0d1236b5b9be15f7d4792fe7f31139a4362b2952d6a0
|
||||
initial_ast: fa1fdad66c8c909e5820c04faa4709ef8c13d92933bf2d310202293b6851ac01
|
||||
symbol_table: f601b6a1652f79ac2853737ecf09f4e5f23c05873e2bb3967137a7b2b0085b04
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 3cec4b6f5256f2e9299abbc632cc999d268bfaad48790abeb6efaad6f8081b2f
|
||||
- initial_input_ast: c3b606138d1dc5f4dc541ddc113fb7d6e07cad4cbd1f382fcc0f9b8517077448
|
||||
initial_ast: 3bf00992729530c37d6bd18b45096638d49ae243d31d52d633f065844f2523a4
|
||||
symbol_table: 5bb0a34e488683807eef29093f204fb2f1cfe8da3c2e2370d61e427a109a2d4a
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 26679d48a4f878012c9f9cacccf9d2d1ef568126030a21abf74a5a4d8e5116d4
|
||||
initial_ast: cc14440f67a0aecc81bc6e1aac0b5571fa1b9937af6ff3dde20addfce27be9e4
|
||||
- initial_input_ast: 138147dfed32a1089f1d6a4ce19ef4f5278dcdbc2012c432ab460bc0601aaa11
|
||||
initial_ast: 8ab7c0eefb3da8ee71f77391565e5d0ee349e690d8cb6f8d8cda9e6582b9d3c5
|
||||
symbol_table: 577abb859b2f33b9e81c5e94c82b559601f44025143fa7a6757561b47e78efa5
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EAST0372014]: function `main` shadowed\n --> compiler-test:3:1\n |\n 3 | function main(y: bool) -> bool {\n 4 | ...\n 5 | ...\n 6 | }\n | ^\nError [EAST0372014]: function `main` shadowed\n --> compiler-test:3:1\n |\n 3 | function main(y: bool) -> bool {\n 4 | ...\n 5 | ...\n 6 | }\n | ^"
|
||||
- "Error [EAST0372014]: function `main` shadowed\n --> compiler-test:3:1\n |\n 3 | function main(y: bool) -> bool {\n 4 | console.log(\"{}\", 1u8);\n 5 | return y;\n 6 | }\n | ^\nError [EAST0372014]: function `main` shadowed\n --> compiler-test:3:1\n |\n 3 | function main(y: bool) -> bool {\n 4 | console.log(\"{}\", 1u8);\n 5 | return y;\n 6 | }\n | ^"
|
||||
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 607700876d69c8b063ce8dcae912b78737a29cf84b51aa85c78913f23084bc5d
|
||||
symbol_table: d1ff083142697183ed20f1989dd069d1910f9732684ade2ec955004b77853b7a
|
||||
initial_ast: 44bf4ac40eb75f876b48fac10e40513ef093da3c5cbe7f0b921a930408dafd46
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445
|
||||
initial_ast: d350d059ac4c8b9d1ed1ea39e7345770d9587f8c77ca9f9a5debb1d6ef41038c
|
||||
- initial_input_ast: 78b65cde248c05f4abfe2d3cf794fbd44de082303631db7e3002aa724099fee1
|
||||
initial_ast: b9c41b81bba799989ce6abcae9ea82f5ba0564a66709c675db033456ac1ef862
|
||||
symbol_table: 6754c028b1d3793f022a7da93be8510a6844da8a2e45f5dcaa9566252e418ee2
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445
|
||||
initial_ast: 58d1ae0bbcc2c4cf4fa16dc074a64a7a0c4bedef9b0a4230968211edf9b81b26
|
||||
- initial_input_ast: 14d0aff05a3b8673ac44d18a969bd03157e19a724ebe2b6e805fdc82aa1e070d
|
||||
initial_ast: 7266dc80dc8dc35c544868574e0c7654debd2e16f791a9a5ce711685950219a1
|
||||
symbol_table: c45d23aa877641cbf1853709cc103d389f3e3105b5c873f8bb90c3a0c48bd2ff
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445
|
||||
initial_ast: 0bc692fc558896d4c90a4826d54ed1c6d41ce578ee930c3546d1d9d4169b4844
|
||||
- initial_input_ast: 5b2906e1b93966fe1b141bb06b4aa45f7a6e60ae0c0895b96cf870eb246e98b4
|
||||
initial_ast: 07480168f37e751b264e4de7e4ef66cea4db7fb1893de65accc9d1da3435f917
|
||||
symbol_table: 7c82d098d4b483b968c5b928f68a4a6f040bf961bbf5192bf323ddabbe592da8
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445
|
||||
initial_ast: 8e4af69e677c1eb3afc851864e57fc88768d97bbfbd96b1680b263ba3a24ed98
|
||||
- initial_input_ast: 1ee96076151487dc5e1988331d53506585dd380909cbeab8c32d3f6e6913456d
|
||||
initial_ast: c45cde3ccb382a43e8920b48605cbd571b113a699bfa53adfc986e7ce3ab46eb
|
||||
symbol_table: 8bddbedba52c66dc7a86530a2df470eb3222992c10b75842431a82afc7e936d4
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EAST0372014]: function `hi` shadowed\n --> compiler-test:3:1\n |\n 3 | function hi() -> u8 {\n 4 | ...\n 5 | }\n | ^\nError [EAST0372014]: function `hi` shadowed\n --> compiler-test:3:1\n |\n 3 | function hi() -> u8 {\n 4 | ...\n 5 | }\n | ^"
|
||||
- "Error [EAST0372014]: function `hi` shadowed\n --> compiler-test:3:1\n |\n 3 | function hi() -> u8 {\n 4 | return 0u8;\n 5 | }\n | ^\nError [EAST0372014]: function `hi` shadowed\n --> compiler-test:3:1\n |\n 3 | function hi() -> u8 {\n 4 | return 0u8;\n 5 | }\n | ^"
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: ee823464d3be14662261697b47c73a67a47c47558987333869ea6e72d6e34ebf
|
||||
initial_ast: 9be3781304a8515dd1a5e35ce3a23574d3b73d5403a46dbd33bb698c7f5f235a
|
||||
- initial_input_ast: f4e1b23f37abb9bcb386ddfd37ee066395d8e84f8ace0f4eb467264131e89fb0
|
||||
initial_ast: 526ba2fdb0342e958bc77572fab3680301af8e1f576a462bb7d94a348fa5f45e
|
||||
symbol_table: b10964224747af7f8ba12f1b3c0dfa228842b3e08b9b82d785b71def31387144
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: ecd9a5086d5d85f1794e023ff6c06e68cc0b4ae67e3f9abc88cd1354ed8fdfad
|
||||
initial_ast: bd47ab2f7c4c1013c5d401a6e1d6af4f28117203c9decaf9864cb0cc7806efaf
|
||||
- initial_input_ast: a183384b085186e92efdf0ccd221ba0f3de6e75cffc5610ed583ccd95aa4adcb
|
||||
initial_ast: bdee31d5ffcb2f4a27fb4b9deb14fea6a514d72323d827a0c0f8f44cd96aa4b6
|
||||
symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: 640119c4e45f3df44391fe0e08e45a44dfac3a996610e10590666400ceebaff8
|
||||
initial_ast: a5068b93a19a2a1062918085bd20112cf08451b84508236869220df920fefb0a
|
||||
symbol_table: 9a61702119ebc681917d7cb7e40ecafa00354849326bf1182635f27a28da35e9
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: d1df1007245f08ea1398244ba810f689c018c288a85307aabb1632a6a8044de4
|
||||
initial_ast: 11ac6a7372ddf4362cd7eb5a1823c0393db61def4f16c7f6185c4048462e3846
|
||||
symbol_table: e4a96223c049893c904a90f24d069592b33fc137de0f4816cf92089e63663693
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: 36e2dac16d3b386145e585988c6dbd41890556deaa10e6776d0bb2e5de8654e3
|
||||
initial_ast: cae7822867b84b0eaedc184a5f5824b45b5a9f2fa3d3262f463b89fd2932de33
|
||||
symbol_table: 1817d91b99941ddc2590c6a2777ad8f7d4ba26a8b2a3baa3932f1a08eb540206
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: ecd9a5086d5d85f1794e023ff6c06e68cc0b4ae67e3f9abc88cd1354ed8fdfad
|
||||
initial_ast: bd47ab2f7c4c1013c5d401a6e1d6af4f28117203c9decaf9864cb0cc7806efaf
|
||||
- initial_input_ast: a183384b085186e92efdf0ccd221ba0f3de6e75cffc5610ed583ccd95aa4adcb
|
||||
initial_ast: bdee31d5ffcb2f4a27fb4b9deb14fea6a514d72323d827a0c0f8f44cd96aa4b6
|
||||
symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 5cce2653606494bd949a7631bb7fe6ab255fbcb1618e5e099875e4f1e9c082aa
|
||||
initial_ast: bd47ab2f7c4c1013c5d401a6e1d6af4f28117203c9decaf9864cb0cc7806efaf
|
||||
- initial_input_ast: eed84b746db9633cd5314c8b23def7c95672f4696824e7504877baa8f62b52ac
|
||||
initial_ast: bdee31d5ffcb2f4a27fb4b9deb14fea6a514d72323d827a0c0f8f44cd96aa4b6
|
||||
symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e765a6e8209951902a890e711b0ebb6b22dfd84149ae1a69bce43530008c17c3
|
||||
initial_ast: 3294e6793786a931be07b6b76eaef2c70ae3fb6e93e0d4eee531d97f69d66158
|
||||
- initial_input_ast: 4a7d722c26d55d9c1c3067f6d2ef891b2afde9cee26a1043ac78ae2f6ce2e8c1
|
||||
initial_ast: 0c31dfc043a0f27d955558a8c97370a490309e59c4de6f228b491a02475b6384
|
||||
symbol_table: 8e39b2bdad6276a42437b673faa0d1dd4f762a9778de1a1e2c8f8edbe5002be4
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: ecd9a5086d5d85f1794e023ff6c06e68cc0b4ae67e3f9abc88cd1354ed8fdfad
|
||||
initial_ast: 3d34068de05401d87f683cae8d8fd4bfd70a036c11504ec8cd870f152f73d590
|
||||
- initial_input_ast: c1a7cb2ec07ebfdcd1f7c0785b389e30ed16055a766d036354e52574a21fa8d9
|
||||
initial_ast: ca9753c3fab4e6189cbbfdcdff9d324c99b0a1dda1ad2a4db5b4fb1864bb0861
|
||||
symbol_table: efa845f46b76b7927005e6e7b8ba6353db6f3a783ec1a8b74993ccc97738eadc
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370004]: Unexpected white space between terms (0,1) and group\n --> compiler-test:4:24\n |\n 4 | const g: group = (0,1) group;\n | ^"
|
||||
- "Error [EPAR0370004]: Unexpected white space between terms (0,1) and group\n --> compiler-test:4:25\n |\n 4 | const g: group = (0,1) group;\n | ^"
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: fcd535c8ebb98650da052ad840712e95af09550a9a00dda1788c2873fa50494f
|
||||
initial_ast: 358ae36c6a14cf236645485eb7284757ceb66125d704cd5121e681e417c0e5bb
|
||||
symbol_table: 1459210791fd0aae2827b2b7c3fd438e7a8315b290e23cbfe365b4214d5cd284
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: d4c0ad5e399b065700d6c8c18c07527ccee14e318b7bb583f7db4709daa53cb7
|
||||
initial_ast: e65d8726f872aacbb712efeda83e69ef0f123f7047ca4c8e839dd3a933400d9d
|
||||
symbol_table: ac8c4425959cf548f2f0edc8aa637b1d827394f11fe2c10ecef366a803fe30a2
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e03c4a2ba40d2e844353081fc62efae967d074fb34a08bd30c99dff1387bd3fd
|
||||
initial_ast: d6bd8a2fd0cd668196c62c8677e2ab436c232904fb2aa2c2991ffe2c22cae3ca
|
||||
- initial_input_ast: 2d76ce81281d5077442c5e6c12b13e536a037f0bb469492ecf0b77191b3ded14
|
||||
initial_ast: e03e381be4b91baad7297381a8d64e1a839a357fe28a6683d18a1bb261f47f7a
|
||||
symbol_table: 0db35c4a8548b1c37607ad3a7d67be41b7949f6219107f4d5ef8442a75dd2a7a
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: 990e4e100ad723d6442328b57d7d77dad65bcc5ecd722b0cdc96239903751656
|
||||
initial_ast: 3db663928afd1ed1616347a7a606020b0f920face30903a41534da9d2bc9c457
|
||||
symbol_table: 877713c611c84057862de19fa49429efb7c57a29ed3ef686b59c1ab3696c4117
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: ee823464d3be14662261697b47c73a67a47c47558987333869ea6e72d6e34ebf
|
||||
initial_ast: 9e93c5e9559bc6597db2a9aa67a287f040d0aba86ca612073f6effc030dfedb6
|
||||
- initial_input_ast: f4e1b23f37abb9bcb386ddfd37ee066395d8e84f8ace0f4eb467264131e89fb0
|
||||
initial_ast: 9cdb1badd73802c1134e8d94dbbacca8bfbb34f70a61886ce6f55ccbc029c525
|
||||
symbol_table: 8d7179908ac5272f4892b2e374ad5c5401332d4d12d7d0505ba1e51a98ef0d6d
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e03c4a2ba40d2e844353081fc62efae967d074fb34a08bd30c99dff1387bd3fd
|
||||
initial_ast: 98ea1b0f102523381afe48d75b4d340ac9020147d1ee0281200611c85cd354b2
|
||||
- initial_input_ast: abe58c662f85737a1bdb4b3e55c3e455e128ff543cbee00637b5b33aee554202
|
||||
initial_ast: d75014d735c603b442bf7e21a9c0c40880a44bc4a2b47d99d87b1c396290f814
|
||||
symbol_table: 5e96e4138e5643222224de143ab32b6716c4dbaf965318b48eaf9e4ba63f8586
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: ac3df9e6585030525d6a239804547b3bddbfa868a718bed7346809d6c237323f
|
||||
initial_ast: 01b83b6b40e30e1c409d1b1621a69c278901f44cb87377b5e232857fd410016e
|
||||
symbol_table: 2d0db26fa84f8daad71afd4420718043de1c97757ae4fe4fa78e9874891d1d80
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: bc5d6bd28dc6b91827d8a47119e0a967641b48fc846195a2640a239ad3d3b999
|
||||
initial_ast: 929abdfa3a41fcdf316b11d4c85fa9a62dc2c4c4814ab96c6e64d97ca2fe14cf
|
||||
symbol_table: c20979f64468655131a488980c1de31384fd7ff35561ed569c3db6f2d0bc19cc
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: dad8ac7c90d3f7c819b89bbd605e9d75511a986b131aceae7c49679f1abf52c4
|
||||
initial_ast: 5e9eb2833c5921c31740f8a98d8c96043b386e846052f2384b0dee4765718d91
|
||||
symbol_table: f450d14b0bb862b0bec4a5f8d41eb92f7cf951dee469505fb20dbfa25972eb7b
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: ea56c82e2bb78e844189f3edfe72d4146e0668a8799ab1fe81b40af70cfce0a8
|
||||
initial_ast: 7c442d2a9b6f3772bd7a1ae070368b7327441e216f2f73e1a81f4d696c96ce05
|
||||
symbol_table: 52760622da95d189f6e707df97fc6bba4216fa59022a4ae79d840b9c05fdf5b1
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: c7ea9a8601a4823e6ffae4c4d0850ef35b7d7780f02e3beb3dda32e460c3a4d0
|
||||
initial_ast: 265e47c26910b5bfd5f775ef3c559bffa66f4790ad2d8c730eeec4088aade505
|
||||
symbol_table: d3bf69e78619e63bc1c56c1efe49712b226f5d477e1c42491d0b31e24d5a98a7
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: 44b026a078f6f146b69faa0c3ef8bccc58155f4e0dd881eb49e37e9065d41dcf
|
||||
initial_ast: 11a6f8f5c1d6500f810c16eaee613f87b52fbd1476378a811767f6ac8a4a0710
|
||||
symbol_table: 026430e928e2236167d6587cb1885784f30bbc916f75d3a0f42fa7a3f2c6978b
|
||||
|
@ -4,5 +4,5 @@ expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: no input
|
||||
initial_ast: 641d4cd14081d30f12865f50c6c1ab1acfaeece382f03d9bb82c73efa1518766
|
||||
initial_ast: dec9c3d59962521ff0dc46c1b66293856d0ffbad30b68eb7f391ace47e3b5eae
|
||||
symbol_table: b181fa2d3c50419dbdaadbe2e91aa4a3e17baa614b0635f9ce6fa7367ead48eb
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: dcc83a9319d9784c4bed7596d95f4bb19e2f5db1122e17bfa37e3458ed69c4fd
|
||||
initial_ast: 9884537ac9d91278f53bca357c89bcb9fcd3e73bb94d9db8eeae8af373e47764
|
||||
- initial_input_ast: 14d3cbbf97803da5b6c304e7b5ec5adcbb1583db29ba46aef485df97e7d54aaa
|
||||
initial_ast: 160907d0f277fbcc876921a00dd1daa878fe5bf4716686d47cf0f790dc40898f
|
||||
symbol_table: 00f652a7b8e969478d433c749951ee63b97343691ff9ade7e1e9288757814ef6
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 0c1be8e106149f3dbe5d151e6372f7d6acf3d0986643537ed9610c2f89eb9ed4
|
||||
initial_ast: 3d7e874a9a015c0ce76f63ee8dfaa0b7d090919baca39e58cf545f0c81a4475e
|
||||
- initial_input_ast: 922bd957ea990634b596ed7a33bf2394d3aaa138be4bfd3882085cdf66ae1da9
|
||||
initial_ast: cce7570723f40bd60042a7f4d691db9862b3a8b9180bfa5d8630ed07eb1bbb62
|
||||
symbol_table: a3dad989c81fa120b3092919ca6bd0cc90221424459f5691b7f172e5564ba1ae
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 723e9ab87822d7d8d793ca1611eabcebc684097a64f37a4cd246ff9e506a4865
|
||||
initial_ast: 859a9100240b8dee329a930cae6345f5439da844613f48b19e342b007cb9e03a
|
||||
- initial_input_ast: a610c3b16aefb8d1dcf55aa316fadd3da191a4045279d74de5667b795a079ba4
|
||||
initial_ast: 14b47cd09e5cca03ce44fe3f038294840fb2259aef8c912ed8e9f41494d62338
|
||||
symbol_table: 3b68eff86b45e4f940b0a1031e19a64178b0bf802acb59f3b743e664f3010876
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: ce38ef1ec7bdaaf35b68d011803255589ed870002583000a76f137d7682bc3d6
|
||||
initial_ast: 10403bb15edbbbd8cf3f22b812c04f723609c8ea33be44b4943c1f392e4e3c2e
|
||||
- initial_input_ast: b26b209013041060043f6269635f9af934cc06c0f8384a8b0e6b10df0d3f5cb9
|
||||
initial_ast: 66ae45c15c3f26615d40f25b904599180fbc7fb8f38c20b1249abb1e8d3dd2a1
|
||||
symbol_table: 031a91bf50d051b6ffb92f6853fa4bece1f5f8f0aa145a28abed6bd1d4cf7bdd
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3273de56f5b29e324e4f4ef3cc7c0c8d468962214728d611aeb4b788fd73aefb
|
||||
initial_ast: 42c8a84d865a9a964326fb4833c82c633adf3e85bc98b7a9995b3544b17683d1
|
||||
- initial_input_ast: 0aad54fd47d9c5f87dc0559e8c7cde742e1f6ea554f26d00367cf5b03921495e
|
||||
initial_ast: 56cb9d299b0ad0d22a31929f017aebc28ca23d2217f5a5b8fd247548d5b39a3a
|
||||
symbol_table: ec750d5d5f4a1e5b31a63e0bc8e12944eef200f2d71efcdb0fd85811ac6e2d31
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: eebcd00b27aba004420d4f00da025325da9ff86d29162e54401fa55b5758ae39
|
||||
initial_ast: 94bd517ef2de4cf61c4e3283b072c8efdd9c824dd00479e59dae1e19aa1133b5
|
||||
- initial_input_ast: ab788992b0e08b3ba20bde1db2c473a4e006f06adefcddca936b148efff76b89
|
||||
initial_ast: 3558d89ef38d1a8f0f2b458b79c0b50aa9736d9c3d1af04435ac5f2253df2f44
|
||||
symbol_table: 14140f05d5fb8a85352940a67860fd36ed597f93ac882fdb76ef3d1ed89b5031
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 81306ba48e4ea08106311612bfd5c1bce79242ca08695fda8584780329266063
|
||||
initial_ast: 4a249f544fc369103704f26be6d6d8b6642b9f76be6f89c43439c9219ad1dd3f
|
||||
- initial_input_ast: b9e3c34f642651adf69796a7619a504427dcc3ff7733e5a8925dd31bb1677e9a
|
||||
initial_ast: c4eadb0618a6696d4c4bc807bf3a3ceebd2ba8f8a09af15c8a8dbb6882c9286c
|
||||
symbol_table: 9674d1e094af108a21c9a8f2e9c5b911f76504d728866f9b57b6e38318c52741
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 0eb1ad9d13a2a11ba96f8ae311f1f91922abd5316ec123f92be78864c33464b4
|
||||
initial_ast: e57eedde564d152e87415ebe4d0034b72ed2c094853c2df80d782e43e7dd85f7
|
||||
- initial_input_ast: bc7b8f4d7b989dc43d4fd55b9682cc77d2984e841678f57fdf605ff2c168861e
|
||||
initial_ast: 6c64e056b0e3ea6cf3056c72b6afddca5a7a69c8a613374af458609132c5121d
|
||||
symbol_table: 26e29ab43161625435a7de57fba18feffa2ca86b908d3720a652c8fabc1a6adf
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
initial_ast: 24b3e77bc04174e1bbf31ec0909da2e4bd16b0b7f23ca7259cb08c8ea8d3951c
|
||||
- initial_input_ast: 539ffcc6201d34ff3e699671d520e5fd6344a2ca8268c8351d7e9c707d8339d2
|
||||
initial_ast: ce1dd4af976d6f5bdc38ef13ad06cc04b2d1e97aa610b59c30bc24bf5a54ca07
|
||||
symbol_table: 6f25f2987af24695b2fb70fb856a108c3d185a98289e796f5af4cb60c0de946a
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: a8d3b28b557b2c19b8bb0083c015f5f217971e856d0a5c2462e956bf55b68126
|
||||
initial_ast: 26e7559cdaef975b7b805f7cff6a7aaabcae77753c4c9613a746f1c490bc89e4
|
||||
- initial_input_ast: ee172614c7f65202cea0ef58ece4a000d22ff2ecca413bf31ad38683c9b4d85e
|
||||
initial_ast: a82840110989a3ca02913febd64b38e9944e461a11a0418f32eb7dde12f41832
|
||||
symbol_table: 13298cf22dc30ccc0e18f787e657068fd0531e71e9b29155541503bf7209801b
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
initial_ast: ce9145527b105baf75ed6b5be8dcdd3161aadc05d312bf05306de5d4990c56bc
|
||||
- initial_input_ast: d849a1509e204680cd676c85564c4945549b5b758969f13fd54c0829f6c7e1c0
|
||||
initial_ast: 2013456984c7e8d66bbeba2262c1c9aa93ebfa4a7cba48143adc172bc0a5fad3
|
||||
symbol_table: e354ff29052ba6cf646dc2a940fb2489c740245554aa81f4a9b71c314f431618
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
- initial_input_ast: 9dd6bd7a655947faefb64c288a9e9411b81148989543a4766fbad39a957dc8eb
|
||||
initial_ast: 2ce3977afce2bb7a1c362793d8651945754d20d73a8d499be086aa1116ae347c
|
||||
- initial_input_ast: 5482379ffdd5eb5f96e55e91bc41680d9730b22b7c3930a08ac0695578c9a1db
|
||||
- initial_input_ast: 0e7fa8784578e26d2c0f05a8aee2f23d7930078ab97dd2252832450ca9cd50eb
|
||||
initial_ast: c16640e8adc00348847a0a48e7a80668cad4b15582277057b9326eedc225178e
|
||||
symbol_table: a0b9f85aee4a145dd4f5a8f6488b4d50a627e317601a523b63b13cc969325401
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
- initial_input_ast: cc80ffa5e25d4c0dcaf6154575b54f85ff5c2f86f50830a966e51bdd8f2274d0
|
||||
initial_ast: 61cc3ea902ea0f09089df912d1e5f195f53e37673e17f25faae0dff5dd90ed09
|
||||
- initial_input_ast: c7a69306fb22539be155f8c31e9d1d0cfaefb35c6d6fe447316421408d126d82
|
||||
- initial_input_ast: f06eb33da0612e0927563d34af8823d655c5f033ebb2426d7d2a5fb2c7691cee
|
||||
initial_ast: 2b54d4799d58745c1d9822b371d4231fd8d24505929397c51ab784d82fcdefa6
|
||||
symbol_table: 96ff00c92d164363ceb1fee06485b451062e76798f4381afa4141d60b2e88c96
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
- initial_input_ast: 2bc5e353d29b75113a1b8976eddb617e0476110a0396b0dfc2dd48481803017c
|
||||
initial_ast: ef3fba23ee70ce1bc7b3b5f75d32c61402b69f6ab95e8e315d56948037a1089a
|
||||
- initial_input_ast: 5482379ffdd5eb5f96e55e91bc41680d9730b22b7c3930a08ac0695578c9a1db
|
||||
- initial_input_ast: 586889c97fa271198358a40227efffae06f141c9f79f3479e03dd01a99003fad
|
||||
initial_ast: 9fb1b4e33ca9d46c1c709c1ff79fd8f5f107a6ec8bbd52df9afba0d9669857f9
|
||||
symbol_table: 4beca34f91e3bb4fbb997a1851b3fefb933c47d1e24f6a2e6258d4075c01918a
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
- initial_input_ast: 5c8741c117817e7996c0add338f5d29437be59d7b7e3f7a68a2e575871c57824
|
||||
initial_ast: aee5bb2b3a8c8c28bb69cda45ef7fac4ac3b7e2474ce82464eba446a7db6e0c6
|
||||
- initial_input_ast: 70eaacd52d656c1871fb3fc2e0fa9427ba1c677c0e66a99596c3b223b76b36e7
|
||||
- initial_input_ast: 126c75bc526b0ae168cccc25e3794140aba4d4962cf3b5561d6d510dc0f15d4c
|
||||
initial_ast: df5aff77b41456a12c8296e8ed08d58d73a7d9e7e37550692e0ff89729c556b0
|
||||
symbol_table: ad21c0cb65fd2f4f2360ed81da1bf608b83a0865801d2b569035eb1e36a7676a
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2
|
||||
initial_ast: 68e5c01d40ca62a3206904b472ec80d1209b8744d441e281c978d7216e3cebd8
|
||||
- initial_input_ast: a74c1b7af568d593690e7ba3823c660f7163e5d90d8bbace6f742eb7da1ae6ff
|
||||
initial_ast: 8c2467e2b9c1ce3e01f796c633f85bf8e786e57ebc4152b594834e5ffffe9735
|
||||
symbol_table: b9f23cb88072c4321465b95ec69bba96f8fb225616244266e05a9e6eeb99da5b
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2
|
||||
initial_ast: 663e59cc593d0eeac44f2497c059d9f6d8fb879939b2557cc45f908840550e48
|
||||
- initial_input_ast: f96b60255571f1dfe682e966e680fd3b250f9b1f7ec99ee0834357e7674e8e28
|
||||
initial_ast: 0cf689ce997b9c05d83bfcd527145365624af6af769d4e63121ec3549d549658
|
||||
symbol_table: 6b54f07ea0046f948e794781960eb3df9271e7e2d10be3e278e2b02d4d810da7
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: a0f0026c304d73c93060f61ad3a55094eb1fafaf8663a0e1972275be45d759e6
|
||||
initial_ast: b5ed54eaddf90307658356a3722c6c11abb79e7f7f59e850fd7b34733db7432d
|
||||
- initial_input_ast: 51a13bfc8843ca3425062e8bca777961536fb9e73ecdf2ea5729b78ae288c3db
|
||||
initial_ast: 54e6e433db28a00fba0dcfc7d3e4917a32d6eb4c0f085cea9d76874e5bade9a1
|
||||
symbol_table: c0c0cbcbbb0b8aa5351b8c74dec4bc556103902ca0f1ebcee2067768c553fd83
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100
|
||||
- initial_input_ast: b75ce6366bf607ddeebbfb8a7d491528a89ed4f3d5c4e57fb1480cfec43930e5
|
||||
initial_ast: b82476f35c3cb4385d9381a54ca19c42a3a9f648a40c94aba96d45f720224300
|
||||
- initial_input_ast: dcde1df8d9dcebf8e74fbefaf3a97441be64d6e7bf7eaf11a326a22d2a2510ee
|
||||
- initial_input_ast: 43c4dedc8b3f4521c214c77f25fadbf5b7f7c699a202d0a5f7f50a147fcfba74
|
||||
initial_ast: 5a11b78171fbed087281986d8dec211127188aee46cbde12ec8c438949485c8b
|
||||
symbol_table: ee72f930a06f9409bfa70e2c08cb9453f255bd8ecf13470383dd7592fada8a93
|
||||
|
@ -3,7 +3,7 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 5204f7264d13dc737097c1b0a1c707e19767854e922ba5571e902d23eb6847f4
|
||||
- initial_input_ast: 6c496394ee585ef0d7dc4bb8e1ef5a05656999502f8f466747e4044c439c3aed
|
||||
initial_ast: 2ae2d8df3abe76076d795a88793186dc18776f7208e6443177da1b5b4c086aaa
|
||||
- initial_input_ast: 8069c236c0c35a3547c7dcaa9b49534f9464b002af7876de63765ad4de43f3b3
|
||||
- initial_input_ast: d54ee1fad231ca1c3ed6be769e3cdc439b5af391e565d460482cde536f17a858
|
||||
initial_ast: a37cedd7b3bb9949088b0e71bd658d1d6ddf4434b6b5da70159a96cb734aec5e
|
||||
symbol_table: dbad7f718a950b554310d0eec61a2a595d5232be21ff783f0c8bd647d6275dcb
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2
|
||||
initial_ast: 1944c18852cf66a6e30adb6f92012fbf0b13b2f28d02672b6c7dbbb0b2f0b950
|
||||
- initial_input_ast: a7f4916705593c961ac55adbd9fedfaf9014ff51d6abe44601d6612958da8385
|
||||
initial_ast: e5d4c1480515b53ce68939423c9ad90fbb646f13961bb6e65f5fe8e565873c95
|
||||
symbol_table: 49a0f7957853abe54b078bb95a1091e5262b58ecc5ff8b8e546ff1fe82547e1f
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2
|
||||
initial_ast: 47786a6bfb6598f7e0847dfca1f2014ba4ead1d3f677f5a9da0ceace3fbcecf4
|
||||
- initial_input_ast: 923ee3c36de197882fb5f42ba7f9c9cf7678bd1fde528dd2e0c7d5e82baf2658
|
||||
initial_ast: 4b0dcb44448879d50fc2f7b555db2fbaa2708e47da06d1b5462bcb540d776ba0
|
||||
symbol_table: 7e7d4d32ae1e112e3ca3a14420225132520abf3f8dc327879b7f8f23f85a8b0d
|
||||
|
@ -3,6 +3,6 @@ namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: a3dbcd20f9c1d5bce5a3667831f3cf05667a4b0253bdda31d99d47951ad98259
|
||||
initial_ast: 8189cf6052fd9388350277deb7b988205f8250e9174900d5d77e567c05f5e76b
|
||||
- initial_input_ast: e46079b8a7a9057a5ca358833d1e96586051b7f38040f7f967113a3c6dcd0483
|
||||
initial_ast: 13f7304150ada6b004b2127e2f1e87501c90feb60d561235c0fcb0248357b03d
|
||||
symbol_table: e071ae07079f92ae418d648b75b982c8294698178699e138c3abfe2341d5b3fc
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user