mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
add src and location to dbg
This commit is contained in:
parent
4587c4ebc5
commit
3966d63e2f
21 changed files with 385 additions and 119 deletions
|
@ -269,6 +269,8 @@ pub enum Expr {
|
|||
},
|
||||
|
||||
Dbg {
|
||||
source_location: Box<str>,
|
||||
source: Box<str>,
|
||||
loc_message: Box<Loc<Expr>>,
|
||||
loc_continuation: Box<Loc<Expr>>,
|
||||
variable: Variable,
|
||||
|
@ -1249,7 +1251,7 @@ pub fn canonicalize_expr<'a>(
|
|||
ast::Expr::Dbg(_, _) => {
|
||||
internal_error!("Dbg should have been desugared by now")
|
||||
}
|
||||
ast::Expr::LowLevelDbg(message, continuation) => {
|
||||
ast::Expr::LowLevelDbg(source_location, source, message, continuation) => {
|
||||
let mut output = Output::default();
|
||||
|
||||
let (loc_message, output1) =
|
||||
|
@ -1276,6 +1278,8 @@ pub fn canonicalize_expr<'a>(
|
|||
|
||||
(
|
||||
Dbg {
|
||||
source_location: (*source_location).into(),
|
||||
source: (*source).into(),
|
||||
loc_message: Box::new(loc_message),
|
||||
loc_continuation: Box::new(loc_continuation),
|
||||
variable: var_store.fresh(),
|
||||
|
@ -2097,6 +2101,8 @@ pub fn inline_calls(var_store: &mut VarStore, expr: Expr) -> Expr {
|
|||
}
|
||||
|
||||
Dbg {
|
||||
source_location,
|
||||
source,
|
||||
loc_message,
|
||||
loc_continuation,
|
||||
variable,
|
||||
|
@ -2113,6 +2119,8 @@ pub fn inline_calls(var_store: &mut VarStore, expr: Expr) -> Expr {
|
|||
};
|
||||
|
||||
Dbg {
|
||||
source_location,
|
||||
source,
|
||||
loc_message: Box::new(loc_message),
|
||||
loc_continuation: Box::new(loc_continuation),
|
||||
variable,
|
||||
|
@ -2398,7 +2406,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
|
|||
| ast::Expr::MalformedClosure => true,
|
||||
// Newlines are disallowed inside interpolation, and these all require newlines
|
||||
ast::Expr::Dbg(_, _)
|
||||
| ast::Expr::LowLevelDbg(_, _)
|
||||
| ast::Expr::LowLevelDbg(_, _, _, _)
|
||||
| ast::Expr::Defs(_, _)
|
||||
| ast::Expr::Expect(_, _)
|
||||
| ast::Expr::When(_, _)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue