mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Parse and format inline ingested file imports
This commit is contained in:
parent
42e755677c
commit
4d6e641864
10 changed files with 165 additions and 12 deletions
|
@ -471,6 +471,13 @@ pub enum ValueDef<'a> {
|
|||
>,
|
||||
>,
|
||||
},
|
||||
|
||||
/// e.g. `import "path/to/my/file.txt" as myFile : Str`
|
||||
IngestedFileImport {
|
||||
before_path: &'a [CommentOrNewline<'a>],
|
||||
path: Loc<StrLiteral<'a>>,
|
||||
name: header::KeywordItem<'a, ImportAsKeyword, Loc<Spaced<'a, header::TypedIdent<'a>>>>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
|
@ -1847,6 +1854,11 @@ impl<'a> Malformed for ValueDef<'a> {
|
|||
alias: _,
|
||||
exposed: _,
|
||||
} => false,
|
||||
ValueDef::IngestedFileImport {
|
||||
before_path: _,
|
||||
path,
|
||||
name: _,
|
||||
} => path.is_malformed(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue