mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Parse and format aliases in import defs
This commit is contained in:
parent
933fde77a0
commit
76d799ea13
12 changed files with 85 additions and 6 deletions
|
@ -0,0 +1 @@
|
|||
NotEndOfFile(@12)
|
|
@ -0,0 +1 @@
|
|||
import Json as json
|
|
@ -18,6 +18,7 @@ Defs {
|
|||
name: @8-12 ModuleName(
|
||||
"Json",
|
||||
),
|
||||
alias: None,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import JsonEncode as JE
|
||||
import BytesDecode as BD
|
|
@ -0,0 +1,44 @@
|
|||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
],
|
||||
regions: [
|
||||
@0-23,
|
||||
@24-49,
|
||||
],
|
||||
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: [
|
||||
ModuleImport {
|
||||
name: @7-17 ModuleName(
|
||||
"JsonEncode",
|
||||
),
|
||||
alias: Some(
|
||||
@21-23 ModuleName(
|
||||
"JE",
|
||||
),
|
||||
),
|
||||
},
|
||||
ModuleImport {
|
||||
name: @31-42 ModuleName(
|
||||
"BytesDecode",
|
||||
),
|
||||
alias: Some(
|
||||
@47-49 ModuleName(
|
||||
"BD",
|
||||
),
|
||||
),
|
||||
},
|
||||
],
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
import JsonEncode as JE
|
||||
import BytesDecode as BD
|
|
@ -200,6 +200,7 @@ mod test_snapshots {
|
|||
fail/if_guard_without_condition.expr,
|
||||
fail/if_missing_else.expr,
|
||||
fail/if_outdented_then.expr,
|
||||
fail/import_with_lowercase_alias.moduledefs,
|
||||
fail/imports_missing_comma.header,
|
||||
fail/inline_hastype.expr,
|
||||
fail/invalid_operator.expr,
|
||||
|
@ -324,6 +325,7 @@ mod test_snapshots {
|
|||
pass/highest_int.expr,
|
||||
pass/if_def.expr,
|
||||
pass/import.moduledefs,
|
||||
pass/import_with_alias.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