first running uw8 module

This commit is contained in:
2021-10-26 20:29:57 +02:00
parent 3b4eeb5f9c
commit af1c8f999b
5 changed files with 28 additions and 13 deletions

View File

@@ -66,9 +66,16 @@ fn import(s: &str) -> IResult<ast::Import> {
map(
preceded(
ws(tag("global")),
pair(identifier, preceded(ws(char(':')), type_)),
pair(
pair(opt(ws(tag("mut"))), identifier),
preceded(ws(char(':')), type_),
),
),
|(name, type_)| ast::ImportType::Variable { name, type_ },
|((mutable, name), type_)| ast::ImportType::Variable {
name,
type_,
mutable: mutable.is_some(),
},
),
))(s)?;
let (s, _) = ws(char(';'))(s)?;