From 3ac605e6876056fa56098231cc2f96553faab8f0 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 20 Dec 2018 21:56:28 +0100 Subject: Add beginnings of type infrastructure --- crates/ra_syntax/src/grammar.ron | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_syntax/src/grammar.ron') diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index eed67637e..c43db51b6 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -346,7 +346,7 @@ Grammar( "TupleExpr": (), "ArrayExpr": (), - "ParenExpr": (), + "ParenExpr": (options: ["Expr"]), "PathExpr": (options: ["Path"]), "LambdaExpr": ( options: [ @@ -377,7 +377,7 @@ Grammar( "BlockExpr": ( options: [ "Block" ] ), - "ReturnExpr": (), + "ReturnExpr": (options: ["Expr"]), "MatchExpr": ( options: [ "Expr", "MatchArmList" ], ), @@ -405,10 +405,10 @@ Grammar( ), "IndexExpr": (), "FieldExpr": (), - "TryExpr": (), - "CastExpr": (), - "RefExpr": (), - "PrefixExpr": (), + "TryExpr": (options: ["Expr"]), + "CastExpr": (options: ["Expr", "TypeRef"]), + "RefExpr": (options: ["Expr"]), + "PrefixExpr": (options: ["Expr"]), "RangeExpr": (), "BinExpr": (), "String": (), @@ -521,7 +521,7 @@ Grammar( ), "SelfParam": (), "Param": ( - options: [ "Pat" ], + options: [ "Pat", "TypeRef" ], ), "UseItem": ( options: [ "UseTree" ] -- cgit v1.2.3 From 3899898d75176ce3cd87f9e2acecd7e3a987dda5 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 22 Dec 2018 22:17:55 +0100 Subject: Parse integer / float types --- crates/ra_syntax/src/grammar.ron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/grammar.ron') diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index c43db51b6..29b84854a 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -304,7 +304,7 @@ Grammar( "ParenType": (), "TupleType": (), "NeverType": (), - "PathType": (), + "PathType": (options: ["Path"]), "PointerType": (), "ArrayType": (), "SliceType": (), -- cgit v1.2.3 From 93ffbf80c632a7d38fc8bbdf6357bfd26a96a35a Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 Dec 2018 13:22:29 +0100 Subject: Make let statements kind of work --- crates/ra_syntax/src/grammar.ron | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ra_syntax/src/grammar.ron') diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 29b84854a..8dca493ee 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -499,6 +499,7 @@ Grammar( ), "LetStmt": ( options: [ ["pat", "Pat"], + ["type_ref", "TypeRef"], ["initializer", "Expr"], ]), "Condition": ( -- cgit v1.2.3 From ef67581104eb00a0c199f0b2a3b558da8a6f90a2 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 Dec 2018 17:13:11 +0100 Subject: Resolve paths to defs (functions currently) during type inference --- crates/ra_syntax/src/grammar.ron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/grammar.ron') diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 8dca493ee..e3b9032a0 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -254,7 +254,7 @@ Grammar( ], options: [ "ParamList", ["body", "Block"], "RetType" ], ), - "RetType": (), + "RetType": (options: ["TypeRef"]), "StructDef": ( traits: [ "NameOwner", -- cgit v1.2.3