mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +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
|
@ -0,0 +1,2 @@
|
|||
import "path/to/file.txt" as file : Str
|
||||
import "path/to/file.txt" as file : List U8
|
|
@ -0,0 +1,74 @@
|
|||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
],
|
||||
regions: [
|
||||
@0-39,
|
||||
@40-85,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 1, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
IngestedFileImport {
|
||||
before_path: [],
|
||||
path: @7-25 PlainLine(
|
||||
"path/to/file.txt",
|
||||
),
|
||||
name: KeywordItem {
|
||||
keyword: Spaces {
|
||||
before: [],
|
||||
item: ImportAsKeyword,
|
||||
after: [],
|
||||
},
|
||||
item: @29-39 TypedIdent {
|
||||
ident: @29-33 "file",
|
||||
spaces_before_colon: [],
|
||||
ann: @36-39 Apply(
|
||||
"",
|
||||
"Str",
|
||||
[],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
IngestedFileImport {
|
||||
before_path: [],
|
||||
path: @47-65 PlainLine(
|
||||
"path/to/file.txt",
|
||||
),
|
||||
name: KeywordItem {
|
||||
keyword: Spaces {
|
||||
before: [],
|
||||
item: ImportAsKeyword,
|
||||
after: [],
|
||||
},
|
||||
item: @70-85 TypedIdent {
|
||||
ident: @70-74 "file",
|
||||
spaces_before_colon: [],
|
||||
ann: @78-85 Apply(
|
||||
"",
|
||||
"List",
|
||||
[
|
||||
@83-85 Apply(
|
||||
"",
|
||||
"U8",
|
||||
[],
|
||||
),
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
import "path/to/file.txt" as file : Str
|
||||
import "path/to/file.txt" as file : List U8
|
|
@ -329,6 +329,7 @@ mod test_snapshots {
|
|||
pass/import_with_alias.moduledefs,
|
||||
pass/import_with_comments.moduledefs,
|
||||
pass/import_with_exposed.moduledefs,
|
||||
pass/ingested_file.moduledefs,
|
||||
pass/int_with_underscore.expr,
|
||||
pass/interface_with_newline.header,
|
||||
pass/lambda_in_chain.expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue