mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Use $crate in loc macro instead of outside imports
This commit is contained in:
parent
cc74c37045
commit
76b815ab77
4 changed files with 4 additions and 3 deletions
|
@ -1348,6 +1348,8 @@ where
|
||||||
macro_rules! loc {
|
macro_rules! loc {
|
||||||
($parser:expr) => {
|
($parser:expr) => {
|
||||||
move |arena, state: State<'a>| {
|
move |arena, state: State<'a>| {
|
||||||
|
use $crate::region::{Located, Region};
|
||||||
|
|
||||||
let start_col = state.column;
|
let start_col = state.column;
|
||||||
let start_line = state.line;
|
let start_line = state.line;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use parse::blankspace::{space0, space0_before};
|
||||||
use parse::collection::collection;
|
use parse::collection::collection;
|
||||||
use parse::ident::unqualified_ident;
|
use parse::ident::unqualified_ident;
|
||||||
use parse::parser::{and, char, map_with_arena, optional, skip_first, Parser, State};
|
use parse::parser::{and, char, map_with_arena, optional, skip_first, Parser, State};
|
||||||
use region::{Located, Region};
|
use region::Located;
|
||||||
|
|
||||||
/// Parse a record - generally one of these two:
|
/// Parse a record - generally one of these two:
|
||||||
///
|
///
|
||||||
|
|
|
@ -9,7 +9,7 @@ use parse::parser::{
|
||||||
unexpected_eof, zero_or_more, ParseResult, Parser, State,
|
unexpected_eof, zero_or_more, ParseResult, Parser, State,
|
||||||
};
|
};
|
||||||
use parse::record::record;
|
use parse::record::record;
|
||||||
use region::{Located, Region};
|
use region::Located;
|
||||||
|
|
||||||
pub fn located<'a>(min_indent: u16) -> impl Parser<'a, Located<TypeAnnotation<'a>>> {
|
pub fn located<'a>(min_indent: u16) -> impl Parser<'a, Located<TypeAnnotation<'a>>> {
|
||||||
one_of5(
|
one_of5(
|
||||||
|
|
|
@ -13,7 +13,6 @@ mod test_format {
|
||||||
use roc::parse::ast::{format, Attempting, Expr};
|
use roc::parse::ast::{format, Attempting, Expr};
|
||||||
use roc::parse::blankspace::space0_before;
|
use roc::parse::blankspace::space0_before;
|
||||||
use roc::parse::parser::{Fail, Parser, State};
|
use roc::parse::parser::{Fail, Parser, State};
|
||||||
use roc::region::{Located, Region};
|
|
||||||
|
|
||||||
fn parse_with<'a>(arena: &'a Bump, input: &'a str) -> Result<Expr<'a>, Fail> {
|
fn parse_with<'a>(arena: &'a Bump, input: &'a str) -> Result<Expr<'a>, Fail> {
|
||||||
let state = State::new(&input, Attempting::Module);
|
let state = State::new(&input, Attempting::Module);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue