diff --git a/asg/src/reducer/monoidal_director.rs b/asg/src/reducer/monoidal_director.rs index ce34755a11..161183a19b 100644 --- a/asg/src/reducer/monoidal_director.rs +++ b/asg/src/reducer/monoidal_director.rs @@ -238,9 +238,7 @@ impl<'a, T: Monoid, R: MonoidalReducerStatement<'a, T>> MonoidalDirector<'a, T, pub fn reduce_console(&mut self, input: &ConsoleStatement<'a>) -> T { let argument = match &input.function { ConsoleFunction::Assert(e) => self.reduce_expression(e.get()), - ConsoleFunction::Debug(f) | ConsoleFunction::Error(f) | ConsoleFunction::Log(f) => { - self.reduce_formatted_string(f) - } + ConsoleFunction::Error(f) | ConsoleFunction::Log(f) => self.reduce_formatted_string(f), }; self.reducer.reduce_console(input, argument) diff --git a/asg/src/reducer/reconstructing_director.rs b/asg/src/reducer/reconstructing_director.rs index 75127d477a..bd2900d3e8 100644 --- a/asg/src/reducer/reconstructing_director.rs +++ b/asg/src/reducer/reconstructing_director.rs @@ -259,7 +259,7 @@ impl<'a, R: ReconstructingReducerStatement<'a>> ReconstructingDirector<'a, R> { let argument = self.reduce_expression(argument.get()); self.reducer.reduce_console_assert(input, argument) } - ConsoleFunction::Debug(f) | ConsoleFunction::Error(f) | ConsoleFunction::Log(f) => { + ConsoleFunction::Error(f) | ConsoleFunction::Log(f) => { let formatted = self.reduce_formatted_string(f.clone()); self.reducer.reduce_console_log(input, formatted) } diff --git a/asg/src/reducer/reconstructing_reducer.rs b/asg/src/reducer/reconstructing_reducer.rs index 755c2eed1c..1a17b886c0 100644 --- a/asg/src/reducer/reconstructing_reducer.rs +++ b/asg/src/reducer/reconstructing_reducer.rs @@ -300,7 +300,6 @@ pub trait ReconstructingReducerStatement<'a>: ReconstructingReducerExpression<'a span: input.span, function: match input.function { ConsoleFunction::Assert(_) => unimplemented!(), - ConsoleFunction::Debug(_) => ConsoleFunction::Debug(argument), ConsoleFunction::Error(_) => ConsoleFunction::Error(argument), ConsoleFunction::Log(_) => ConsoleFunction::Log(argument), }, diff --git a/asg/src/reducer/visitor_director.rs b/asg/src/reducer/visitor_director.rs index dc6dae6929..2d238e67aa 100644 --- a/asg/src/reducer/visitor_director.rs +++ b/asg/src/reducer/visitor_director.rs @@ -336,9 +336,7 @@ impl<'a, R: StatementVisitor<'a>> VisitorDirector<'a, R> { VisitResult::VisitChildren => { match &input.function { ConsoleFunction::Assert(e) => self.visit_expression(e)?, - ConsoleFunction::Debug(f) | ConsoleFunction::Error(f) | ConsoleFunction::Log(f) => { - self.visit_formatted_string(f)? - } + ConsoleFunction::Error(f) | ConsoleFunction::Log(f) => self.visit_formatted_string(f)?, } Ok(()) } diff --git a/asg/src/statement/console.rs b/asg/src/statement/console.rs index 37359f90b3..5708576425 100644 --- a/asg/src/statement/console.rs +++ b/asg/src/statement/console.rs @@ -30,7 +30,6 @@ pub struct ConsoleArgs<'a> { #[derive(Clone)] pub enum ConsoleFunction<'a> { Assert(Cell<&'a Expression<'a>>), - Debug(ConsoleArgs<'a>), Error(ConsoleArgs<'a>), Log(ConsoleArgs<'a>), } @@ -89,7 +88,6 @@ impl<'a> FromAst<'a, leo_ast::ConsoleStatement> for ConsoleStatement<'a> { AstConsoleFunction::Assert(expression) => ConsoleFunction::Assert(Cell::new( <&Expression<'a>>::from_ast(scope, expression, Some(Type::Boolean.into()))?, )), - AstConsoleFunction::Debug(args) => ConsoleFunction::Debug(ConsoleArgs::from_ast(scope, args, None)?), AstConsoleFunction::Error(args) => ConsoleFunction::Error(ConsoleArgs::from_ast(scope, args, None)?), AstConsoleFunction::Log(args) => ConsoleFunction::Log(ConsoleArgs::from_ast(scope, args, None)?), }, @@ -103,7 +101,6 @@ impl<'a> Into for &ConsoleStatement<'a> { leo_ast::ConsoleStatement { function: match &self.function { Assert(e) => AstConsoleFunction::Assert(e.get().into()), - Debug(args) => AstConsoleFunction::Debug(args.into()), Error(args) => AstConsoleFunction::Error(args.into()), Log(args) => AstConsoleFunction::Log(args.into()), }, diff --git a/asg/tests/pass/console/debug.leo b/asg/tests/pass/console/debug.leo deleted file mode 100644 index 54e6eb539f..0000000000 --- a/asg/tests/pass/console/debug.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.debug("hello debug"); -} \ No newline at end of file diff --git a/asg/tests/pass/console/mod.rs b/asg/tests/pass/console/mod.rs index 4f1a243012..43d3c0e0cb 100644 --- a/asg/tests/pass/console/mod.rs +++ b/asg/tests/pass/console/mod.rs @@ -40,14 +40,6 @@ fn test_log_input() { load_asg(program_string).unwrap(); } -// Debug - -#[test] -fn test_debug() { - let program_string = include_str!("debug.leo"); - load_asg(program_string).unwrap(); -} - // Error #[test] diff --git a/ast/src/errors/error.rs b/ast/src/errors/error.rs index 0cf34f5d25..b2c1ebff5a 100644 --- a/ast/src/errors/error.rs +++ b/ast/src/errors/error.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{LeoError, Span}; - use std::{fmt, sync::Arc}; pub const INDENT: &str = " "; @@ -77,20 +76,21 @@ impl fmt::Display for FormattedError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let underline = underline(self.col_start, self.col_stop); - write!( - f, + let error_message = format!( "{indent }--> {path}:{line_start}:{start}\n\ - {indent } |\n", + {indent } ", indent = INDENT, path = &*self.path, line_start = self.line_start, start = self.col_start, - )?; + ); + + write!(f, "{}", error_message)?; for (line_no, line) in self.content.lines().enumerate() { writeln!( f, - "{line_no:width$} | {text}", + "|\n{line_no:width$} | {text}", width = INDENT.len(), line_no = self.line_start + line_no, text = line, diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index 4c78012c30..edf300ada4 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -392,7 +392,7 @@ impl Canonicalizer { ConsoleFunction::Assert(expression) => { ConsoleFunction::Assert(self.canonicalize_expression(expression)) } - ConsoleFunction::Debug(args) | ConsoleFunction::Error(args) | ConsoleFunction::Log(args) => { + ConsoleFunction::Error(args) | ConsoleFunction::Log(args) => { let parameters = args .parameters .iter() @@ -406,7 +406,6 @@ impl Canonicalizer { }; match &console_function_call.function { - ConsoleFunction::Debug(_) => ConsoleFunction::Debug(console_args), ConsoleFunction::Error(_) => ConsoleFunction::Error(console_args), ConsoleFunction::Log(_) => ConsoleFunction::Log(console_args), _ => unimplemented!(), // impossible diff --git a/ast/src/reducer/reconstructing_director.rs b/ast/src/reducer/reconstructing_director.rs index 80a61e0476..cf5a409d06 100644 --- a/ast/src/reducer/reconstructing_director.rs +++ b/ast/src/reducer/reconstructing_director.rs @@ -390,7 +390,7 @@ impl ReconstructingDirector { ) -> Result { let function = match &console_function_call.function { ConsoleFunction::Assert(expression) => ConsoleFunction::Assert(self.reduce_expression(expression)?), - ConsoleFunction::Debug(args) | ConsoleFunction::Error(args) | ConsoleFunction::Log(args) => { + ConsoleFunction::Error(args) | ConsoleFunction::Log(args) => { let mut parameters = vec![]; for parameter in args.parameters.iter() { parameters.push(self.reduce_expression(parameter)?); @@ -403,7 +403,6 @@ impl ReconstructingDirector { }; match &console_function_call.function { - ConsoleFunction::Debug(_) => ConsoleFunction::Debug(formatted), ConsoleFunction::Error(_) => ConsoleFunction::Error(formatted), ConsoleFunction::Log(_) => ConsoleFunction::Log(formatted), _ => return Err(ReducerError::impossible_console_assert_call(&args.span)), diff --git a/ast/src/statements/console/console_function.rs b/ast/src/statements/console/console_function.rs index 5919980af6..8c782a1e88 100644 --- a/ast/src/statements/console/console_function.rs +++ b/ast/src/statements/console/console_function.rs @@ -22,7 +22,6 @@ use std::fmt; #[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)] pub enum ConsoleFunction { Assert(Expression), - Debug(ConsoleArgs), Error(ConsoleArgs), Log(ConsoleArgs), } @@ -31,7 +30,6 @@ impl fmt::Display for ConsoleFunction { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { ConsoleFunction::Assert(assert) => write!(f, "assert({})", assert), - ConsoleFunction::Debug(debug) => write!(f, "debug({})", debug), ConsoleFunction::Error(error) => write!(f, "error{})", error), ConsoleFunction::Log(log) => write!(f, "log({})", log), } @@ -42,18 +40,14 @@ impl Node for ConsoleFunction { fn span(&self) -> &Span { match self { ConsoleFunction::Assert(assert) => assert.span(), - ConsoleFunction::Debug(formatted) | ConsoleFunction::Error(formatted) | ConsoleFunction::Log(formatted) => { - &formatted.span - } + ConsoleFunction::Error(formatted) | ConsoleFunction::Log(formatted) => &formatted.span, } } fn set_span(&mut self, span: Span) { match self { ConsoleFunction::Assert(assert) => assert.set_span(span), - ConsoleFunction::Debug(formatted) | ConsoleFunction::Error(formatted) | ConsoleFunction::Log(formatted) => { - formatted.set_span(span) - } + ConsoleFunction::Error(formatted) | ConsoleFunction::Log(formatted) => formatted.set_span(span), } } } diff --git a/compiler/src/console/console.rs b/compiler/src/console/console.rs index e3aa490942..46f3dee52a 100644 --- a/compiler/src/console/console.rs +++ b/compiler/src/console/console.rs @@ -39,13 +39,6 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &console.span.clone().unwrap_or_default(), )?; } - ConsoleFunction::Debug(string) => { - let string = self.format(cs, string)?; - - if get_indicator_value(indicator) { - tracing::debug!("{}", string); - } - } ConsoleFunction::Error(string) => { let string = self.format(cs, string)?; diff --git a/compiler/src/phases/reducing_director.rs b/compiler/src/phases/reducing_director.rs index ff432e3f27..2a934909a8 100644 --- a/compiler/src/phases/reducing_director.rs +++ b/compiler/src/phases/reducing_director.rs @@ -597,8 +597,7 @@ impl CombineAstAsgDirector { (AstConsoleFunction::Assert(ast_expression), AsgConsoleFunction::Assert(asg_expression)) => { AstConsoleFunction::Assert(self.reduce_expression(&ast_expression, asg_expression.get())?) } - (AstConsoleFunction::Debug(ast_console_args), AsgConsoleFunction::Debug(asg_format)) - | (AstConsoleFunction::Error(ast_console_args), AsgConsoleFunction::Error(asg_format)) + (AstConsoleFunction::Error(ast_console_args), AsgConsoleFunction::Error(asg_format)) | (AstConsoleFunction::Log(ast_console_args), AsgConsoleFunction::Log(asg_format)) => { let mut parameters = vec![]; for (ast_parameter, asg_parameter) in @@ -614,7 +613,6 @@ impl CombineAstAsgDirector { }; match &ast.function { - AstConsoleFunction::Debug(_) => AstConsoleFunction::Debug(args), AstConsoleFunction::Error(_) => AstConsoleFunction::Error(args), AstConsoleFunction::Log(_) => AstConsoleFunction::Log(args), _ => return Err(ReducerError::impossible_console_assert_call(&ast_console_args.span)), diff --git a/leo/logger.rs b/leo/logger.rs index b2f639ef01..f7f145a4c2 100644 --- a/leo/logger.rs +++ b/leo/logger.rs @@ -218,6 +218,11 @@ pub fn init_logger(_app_name: &'static str, verbosity: usize) -> Result<()> { Err(_) => return Err(anyhow::anyhow!("Error: Failed to enable ansi_support")), }; + use tracing_subscriber::fmt::writer::MakeWriterExt; + + let stderr = std::io::stderr.with_max_level(tracing::Level::WARN); + let mk_writer = stderr.or_else(std::io::stdout); + let subscriber = FmtSubscriber::builder() // all spans/events with a level higher than TRACE (e.g, debug, info, warn, etc.) // will be written to stdout. @@ -227,6 +232,7 @@ pub fn init_logger(_app_name: &'static str, verbosity: usize) -> Result<()> { 2 => tracing::Level::DEBUG, _ => tracing::Level::TRACE }) + .with_writer(mk_writer) .without_time() .with_target(false) .event_format(Format::default()) diff --git a/leo/main.rs b/leo/main.rs index d20347160f..5b633f1634 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -39,6 +39,7 @@ use commands::{ }; use anyhow::Result; +use colored::Colorize; use std::{path::PathBuf, process::exit}; use structopt::{clap::AppSettings, StructOpt}; @@ -229,7 +230,20 @@ fn handle_error(res: Result) -> T { match res { Ok(t) => t, Err(err) => { - eprintln!("Error: {}", err); + eprintln!( + "{} {}", + "Error:".bold().red(), + err.to_string() + .lines() + .enumerate() + .map(|(i, l)| if i == 0 { + l.bold().red().to_string() + } else { + l.to_string() + }) + .collect::>() + .join("\n") + ); exit(1); } } diff --git a/parser/src/parser/statement.rs b/parser/src/parser/statement.rs index d60d3e12bb..1b82145f43 100644 --- a/parser/src/parser/statement.rs +++ b/parser/src/parser/statement.rs @@ -277,13 +277,12 @@ impl ParserContext { let expr = self.parse_expression()?; ConsoleFunction::Assert(expr) } - "debug" => ConsoleFunction::Debug(self.parse_console_args()?), "error" => ConsoleFunction::Error(self.parse_console_args()?), "log" => ConsoleFunction::Log(self.parse_console_args()?), x => { return Err(SyntaxError::unexpected_ident( &x, - &["assert", "debug", "error", "log"], + &["assert", "error", "log"], &function.span, )); } diff --git a/parser/src/test.rs b/parser/src/test.rs index 26d5f9a7d0..0b5c9c3060 100644 --- a/parser/src/test.rs +++ b/parser/src/test.rs @@ -95,7 +95,11 @@ impl Namespace for ParseStatementNamespace { } fn run_test(&self, test: Test) -> Result { - let tokenizer = tokenizer::tokenize("test", test.content.into()).map_err(|x| x.to_string())?; + let tokenizer = tokenizer::tokenize("test", test.content.into()).map_err(|x| { + let s = x.to_string(); + println!("s is {}", s); + s + })?; if tokenizer .iter() .all(|x| matches!(x.token, Token::CommentLine(_) | Token::CommentBlock(_))) @@ -108,7 +112,11 @@ impl Namespace for ParseStatementNamespace { } let mut tokens = ParserContext::new(tokenizer); - let parsed = tokens.parse_statement().map_err(|x| x.to_string())?; + let parsed = tokens.parse_statement().map_err(|x| { + let s = x.to_string(); + println!("bruh {}", s); + s + })?; not_fully_consumed(&mut tokens)?; Ok(serde_yaml::to_value(&parsed).expect("serialization failed")) diff --git a/tests/compiler/console/debug.leo b/tests/compiler/console/debug.leo deleted file mode 100644 index 4b24b6e5fc..0000000000 --- a/tests/compiler/console/debug.leo +++ /dev/null @@ -1,10 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: input/dummy.in -*/ - -function main(y: bool) -> bool { - console.debug("hello debug"); - return y == true; -} diff --git a/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out b/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out index 307885a20d..b38b3bbbf2 100644 --- a/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:6:19\n |\n 6 | const x = a[i..10];\n | ^^^^^^^^\n |\n = array size cannot be inferred, add explicit types" + - " --> compiler-test:7:17\n |\n 7 | console.debug(\"{}\", x);\n | ^^^^^\n |\n = expected identifier 'assert', 'error', 'log' -- got 'debug'" diff --git a/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out b/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out index 104faae420..9bb7631c2d 100644 --- a/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out +++ b/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> :0:0\n |\n |\n |\n = failed to resolve import: 'core'" + - " --> :0:0\n |\n |\n = failed to resolve import: 'core'" diff --git a/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out b/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out index 104faae420..9bb7631c2d 100644 --- a/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out +++ b/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> :0:0\n |\n |\n |\n = failed to resolve import: 'core'" + - " --> :0:0\n |\n |\n = failed to resolve import: 'core'" diff --git a/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out b/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out index 4fb07b9d05..2493893de3 100644 --- a/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out +++ b/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> :0:0\n |\n |\n |\n = failed to resolve import: 'core.unstable'" + - " --> :0:0\n |\n |\n = failed to resolve import: 'core.unstable'" diff --git a/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out b/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out index 7b1e418ef4..aaffccc60a 100644 --- a/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:6:12\n |\n 6 | return 10u32; \n | ^^^^^\n |\n = unexpected type, expected: '()', received: 'u32'" + - "- Circuit has no constraints, use inputs and registers in program to produce them" diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out index 5fcaab60f3..6738b2788e 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:5\n |\n 4 | if true {\n 5 | ...\n 6 | }\n | ^\n |\n = function 'main' failed to validate return path: 'cannot have asymmetrical return in if statement'" + - " --> compiler-test:4:5\n |\n 4 | if true {\n|\n 5 | ...\n|\n 6 | }\n | ^\n |\n = function 'main' failed to validate return path: 'cannot have asymmetrical return in if statement'" diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out index 52b50d8a3e..ee103c4030 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n 4 | ...\n 5 | }\n 6 | \n 7 | \n 8 | \n 9 | \n 10 | \n | ^\n |\n = function 'main' missing return for all paths" + - " --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n|\n 4 | ...\n|\n 5 | }\n|\n 6 | \n|\n 7 | \n|\n 8 | \n|\n 9 | \n|\n 10 | \n | ^\n |\n = function 'main' missing return for all paths" diff --git a/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out index e074c91490..6609ce03a3 100644 --- a/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n 4 | ...\n 5 | }\n | ^\n |\n = Mismatched types. Expected register output type `u8`, found type `bool`." + - " --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n|\n 4 | ...\n|\n 5 | }\n | ^\n |\n = Mismatched types. Expected register output type `u8`, found type `bool`." diff --git a/tests/expectations/parser/parser/statement/console.leo.out b/tests/expectations/parser/parser/statement/console.leo.out index 2ed38532c9..4ff3e93b83 100644 --- a/tests/expectations/parser/parser/statement/console.leo.out +++ b/tests/expectations/parser/parser/statement/console.leo.out @@ -80,73 +80,6 @@ outputs: col_stop: 18 path: test content: "console.error(\"x\");" - - Console: - function: - Debug: - string: - - Scalar: 123 - - Scalar: 125 - parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 15 - col_stop: 22 - path: test - content: "console.debug(\"{}\", x);" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 22 - path: test - content: "console.debug(\"{}\", x);" - - Console: - function: - Debug: - string: - - Scalar: 123 - - Scalar: 125 - - Scalar: 123 - - Scalar: 125 - parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 15 - col_stop: 27 - path: test - content: "console.debug(\"{}{}\", x, y);" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 27 - path: test - content: "console.debug(\"{}{}\", x, y);" - - Console: - function: - Debug: - string: - - Scalar: 120 - parameters: [] - span: - line_start: 1 - line_stop: 1 - col_start: 15 - col_stop: 18 - path: test - content: "console.debug(\"x\");" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 18 - path: test - content: "console.debug(\"x\");" - Console: function: Log: diff --git a/tests/parser/statement/console.leo b/tests/parser/statement/console.leo index ba1b5e2cf4..773ec668b0 100644 --- a/tests/parser/statement/console.leo +++ b/tests/parser/statement/console.leo @@ -13,13 +13,6 @@ console.error("{}{}", x, y); console.error("x"); -console.debug("{}", x); - -console.debug("{}{}", x, y); - -console.debug("x"); - - console.log("{}", x); console.log("{}{}", x, y);