mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
misc improvements
This commit is contained in:
parent
ef68183a92
commit
59ab438c1e
8 changed files with 402 additions and 367 deletions
|
@ -4,8 +4,8 @@ use crate::ast::{
|
|||
use crate::blankspace::space0_e;
|
||||
use crate::expr::merge_spaces;
|
||||
use crate::ident::{lowercase_ident, UppercaseIdent};
|
||||
use crate::parser::{byte, specialize_err, EPackageEntry, EPackageName, Parser};
|
||||
use crate::parser::{optional, then};
|
||||
use crate::parser::{specialize, word1, EPackageEntry, EPackageName, Parser};
|
||||
use crate::string_literal;
|
||||
use roc_module::symbol::{ModuleId, Symbol};
|
||||
use roc_region::all::Loc;
|
||||
|
@ -346,14 +346,14 @@ pub fn package_entry<'a>() -> impl Parser<'a, Spaced<'a, PackageEntry<'a>>, EPac
|
|||
optional(and!(
|
||||
skip_second!(
|
||||
and!(
|
||||
specialize(|_, pos| EPackageEntry::Shorthand(pos), lowercase_ident()),
|
||||
specialize_err(|_, pos| EPackageEntry::Shorthand(pos), lowercase_ident()),
|
||||
space0_e(EPackageEntry::IndentPackage)
|
||||
),
|
||||
word1(b':', EPackageEntry::Colon)
|
||||
byte(b':', EPackageEntry::Colon)
|
||||
),
|
||||
space0_e(EPackageEntry::IndentPackage)
|
||||
)),
|
||||
loc!(specialize(EPackageEntry::BadPackage, package_name()))
|
||||
loc!(specialize_err(EPackageEntry::BadPackage, package_name()))
|
||||
),
|
||||
move |arena, (opt_shorthand, package_or_path)| {
|
||||
let entry = match opt_shorthand {
|
||||
|
@ -380,7 +380,7 @@ pub fn package_entry<'a>() -> impl Parser<'a, Spaced<'a, PackageEntry<'a>>, EPac
|
|||
|
||||
pub fn package_name<'a>() -> impl Parser<'a, PackageName<'a>, EPackageName<'a>> {
|
||||
then(
|
||||
loc!(specialize(
|
||||
loc!(specialize_err(
|
||||
EPackageName::BadPath,
|
||||
string_literal::parse_str_literal()
|
||||
)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue