mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
make Str + Result work
This commit is contained in:
parent
d1d7cfef44
commit
c0d3543d5a
12 changed files with 401 additions and 142 deletions
|
@ -6,6 +6,7 @@ use crate::parser::{specialize, word1, EPackageEntry, EPackageName, Parser};
|
|||
use crate::state::State;
|
||||
use crate::string_literal;
|
||||
use bumpalo::collections::Vec;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_region::all::Loc;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -17,6 +18,10 @@ pub enum HeaderFor<'a> {
|
|||
generates: UppercaseIdent<'a>,
|
||||
generates_with: &'a [Loc<ExposedName<'a>>],
|
||||
},
|
||||
/// Only created during canonicalization, never actually parsed from source
|
||||
Builtin {
|
||||
generates_with: &'a [Symbol],
|
||||
},
|
||||
PkgConfig {
|
||||
/// usually `pf`
|
||||
config_shorthand: &'a str,
|
||||
|
@ -60,11 +65,11 @@ impl<'a> From<ModuleName<'a>> for &'a str {
|
|||
}
|
||||
|
||||
impl<'a> ModuleName<'a> {
|
||||
pub fn new(name: &'a str) -> Self {
|
||||
pub const fn new(name: &'a str) -> Self {
|
||||
ModuleName(name)
|
||||
}
|
||||
|
||||
pub fn as_str(&'a self) -> &'a str {
|
||||
pub const fn as_str(&'a self) -> &'a str {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue