mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Fix --features=parse_debug_trace
This commit is contained in:
parent
d0fe108564
commit
469e1dc9e3
2 changed files with 5 additions and 3 deletions
|
@ -737,6 +737,7 @@ pub trait Parser<'a, Output, Error> {
|
||||||
) -> ParseResult<'a, Output, Error>;
|
) -> ParseResult<'a, Output, Error>;
|
||||||
|
|
||||||
#[cfg(not(feature = "parse_debug_trace"))]
|
#[cfg(not(feature = "parse_debug_trace"))]
|
||||||
|
#[inline(always)]
|
||||||
fn trace(self, _message: &'static str) -> Self
|
fn trace(self, _message: &'static str) -> Self
|
||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
|
@ -789,7 +790,7 @@ impl<'a, O: std::fmt::Debug, E: std::fmt::Debug, P: Parser<'a, O, E>> Parser<'a,
|
||||||
where
|
where
|
||||||
E: 'a,
|
E: 'a,
|
||||||
{
|
{
|
||||||
fn parse(&self, arena: &'a Bump, state: State<'a>) -> ParseResult<'a, O, E> {
|
fn parse(&self, arena: &'a Bump, state: State<'a>, min_indent: u32) -> ParseResult<'a, O, E> {
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
|
@ -803,7 +804,7 @@ where
|
||||||
let cur_indent = INDENT.with(|i| *i.borrow());
|
let cur_indent = INDENT.with(|i| *i.borrow());
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"{:>5?}: {}{:<50}",
|
"{:<5?}: {}{:<50}",
|
||||||
state.pos(),
|
state.pos(),
|
||||||
&indent_text[..cur_indent * 2],
|
&indent_text[..cur_indent * 2],
|
||||||
self.message
|
self.message
|
||||||
|
|
|
@ -133,7 +133,8 @@ impl Position {
|
||||||
|
|
||||||
impl Debug for Position {
|
impl Debug for Position {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "@{}", self.offset)
|
write!(f, "@")?;
|
||||||
|
self.offset.fmt(f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue