mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
pass through correct path and type for ingested file
This commit is contained in:
parent
0c366949cb
commit
56ed985cc9
7 changed files with 25 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::fmt::Debug;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::header::{AppHeader, HostedHeader, InterfaceHeader, PackageHeader, PlatformHeader};
|
||||
use crate::ident::Accessor;
|
||||
|
@ -264,7 +265,7 @@ pub enum Expr<'a> {
|
|||
Tuple(Collection<'a, &'a Loc<Expr<'a>>>),
|
||||
|
||||
// The name of a file to be ingested directly into a variable.
|
||||
IngestedFile(StrLiteral<'a>),
|
||||
IngestedFile(&'a Path, &'a Loc<TypeAnnotation<'a>>),
|
||||
|
||||
// Lookups
|
||||
Var {
|
||||
|
@ -1468,13 +1469,12 @@ impl<'a> Malformed for Expr<'a> {
|
|||
Tag(_) |
|
||||
OpaqueRef(_) |
|
||||
SingleQuote(_) | // This is just a &str - not a bunch of segments
|
||||
IngestedFile(_, _) |
|
||||
Crash => false,
|
||||
|
||||
Str(inner) => inner.is_malformed(),
|
||||
|
||||
// TODO: what is the scope of Malformed? Would this not being a real file make it malformed?
|
||||
IngestedFile(inner) => inner.is_malformed(),
|
||||
|
||||
RecordAccess(inner, _) |
|
||||
TupleAccess(inner, _) => inner.is_malformed(),
|
||||
|
||||
|
|
|
@ -1906,7 +1906,7 @@ fn expr_to_pattern_help<'a>(arena: &'a Bump, expr: &Expr<'a>) -> Result<Pattern<
|
|||
is_negative,
|
||||
},
|
||||
// These would not have parsed as patterns
|
||||
Expr::IngestedFile(_)
|
||||
Expr::IngestedFile(_, _)
|
||||
| Expr::AccessorFunction(_)
|
||||
| Expr::RecordAccess(_, _)
|
||||
| Expr::TupleAccess(_, _)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue