mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
move colum state over
This commit is contained in:
parent
1a49930d1d
commit
256e7adaff
2 changed files with 7 additions and 3 deletions
|
@ -197,7 +197,11 @@ where
|
||||||
Err((MadeProgress, indent_problem(state.pos()), state))
|
Err((MadeProgress, indent_problem(state.pos()), state))
|
||||||
} else {
|
} else {
|
||||||
let comments_and_newlines = Vec::with_capacity_in(newlines, arena);
|
let comments_and_newlines = Vec::with_capacity_in(newlines, arena);
|
||||||
let spaces = eat_spaces(state, false, comments_and_newlines);
|
let mut spaces = eat_spaces(state, false, comments_and_newlines);
|
||||||
|
|
||||||
|
if spaces.multiline {
|
||||||
|
spaces.state.indent_column = spaces.state.column();
|
||||||
|
}
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
MadeProgress,
|
MadeProgress,
|
||||||
|
|
|
@ -13,11 +13,11 @@ pub struct State<'a> {
|
||||||
offset: usize,
|
offset: usize,
|
||||||
|
|
||||||
/// Position of the start of the current line
|
/// Position of the start of the current line
|
||||||
pub line_start: Position,
|
pub(crate) line_start: Position,
|
||||||
|
|
||||||
/// Current indentation level, in columns
|
/// Current indentation level, in columns
|
||||||
/// (so no indent is col 1 - this saves an arithmetic operation.)
|
/// (so no indent is col 1 - this saves an arithmetic operation.)
|
||||||
pub indent_column: u32,
|
pub(crate) indent_column: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> State<'a> {
|
impl<'a> State<'a> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue