mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
get basic wiring of a value through the compiler
This commit is contained in:
parent
5354637cec
commit
f4411afbbc
8 changed files with 22 additions and 5 deletions
|
@ -263,6 +263,9 @@ 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>),
|
||||
|
||||
// Lookups
|
||||
Var {
|
||||
module_name: &'a str, // module_name will only be filled if the original Roc code stated something like `5 + SomeModule.myVar`, module_name will be blank if it was `5 + myVar`
|
||||
|
@ -1469,6 +1472,9 @@ impl<'a> Malformed for Expr<'a> {
|
|||
|
||||
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,8 @@ fn expr_to_pattern_help<'a>(arena: &'a Bump, expr: &Expr<'a>) -> Result<Pattern<
|
|||
is_negative,
|
||||
},
|
||||
// These would not have parsed as patterns
|
||||
Expr::AccessorFunction(_)
|
||||
Expr::IngestedFile(_)
|
||||
| Expr::AccessorFunction(_)
|
||||
| Expr::RecordAccess(_, _)
|
||||
| Expr::TupleAccess(_, _)
|
||||
| Expr::List { .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue