aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar.ron
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-24 14:40:11 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-24 14:40:11 +0000
commit67e768466ff2e2611eead0f30b2e9c4083c80c20 (patch)
tree8984028019837c91131fc30f60eecf8c2a457368 /crates/ra_syntax/src/grammar.ron
parentabe09eb5edfe8f4c58baa16140acbd414635836f (diff)
parent4befde1eee5b1e2b7ddc9bf764b77f82b792c318 (diff)
Merge #327
327: Beginnings of type inference r=flodiebold a=flodiebold I was a bit bored, so I thought I'd try to start implementing the type system and see how far I come :wink: This is obviously still extremely WIP, only very basic stuff working, but I thought I'd post this now to get some feedback as to whether this approach makes sense at all. There's no user-visible effect yet, but the type inference has tests similar to the ones for the parser. My next step will probably be to implement struct types, after which this could probably be used to complete fields. I realize this may all get thrown away when/if the compiler query system gets usable, but I feel like there are lots of IDE features that could be implemented with somewhat working type inference in the meantime :smile: Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar.ron')
-rw-r--r--crates/ra_syntax/src/grammar.ron19
1 files changed, 10 insertions, 9 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index eed67637e..e3b9032a0 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -254,7 +254,7 @@ Grammar(
254 ], 254 ],
255 options: [ "ParamList", ["body", "Block"], "RetType" ], 255 options: [ "ParamList", ["body", "Block"], "RetType" ],
256 ), 256 ),
257 "RetType": (), 257 "RetType": (options: ["TypeRef"]),
258 "StructDef": ( 258 "StructDef": (
259 traits: [ 259 traits: [
260 "NameOwner", 260 "NameOwner",
@@ -304,7 +304,7 @@ Grammar(
304 "ParenType": (), 304 "ParenType": (),
305 "TupleType": (), 305 "TupleType": (),
306 "NeverType": (), 306 "NeverType": (),
307 "PathType": (), 307 "PathType": (options: ["Path"]),
308 "PointerType": (), 308 "PointerType": (),
309 "ArrayType": (), 309 "ArrayType": (),
310 "SliceType": (), 310 "SliceType": (),
@@ -346,7 +346,7 @@ Grammar(
346 346
347 "TupleExpr": (), 347 "TupleExpr": (),
348 "ArrayExpr": (), 348 "ArrayExpr": (),
349 "ParenExpr": (), 349 "ParenExpr": (options: ["Expr"]),
350 "PathExpr": (options: ["Path"]), 350 "PathExpr": (options: ["Path"]),
351 "LambdaExpr": ( 351 "LambdaExpr": (
352 options: [ 352 options: [
@@ -377,7 +377,7 @@ Grammar(
377 "BlockExpr": ( 377 "BlockExpr": (
378 options: [ "Block" ] 378 options: [ "Block" ]
379 ), 379 ),
380 "ReturnExpr": (), 380 "ReturnExpr": (options: ["Expr"]),
381 "MatchExpr": ( 381 "MatchExpr": (
382 options: [ "Expr", "MatchArmList" ], 382 options: [ "Expr", "MatchArmList" ],
383 ), 383 ),
@@ -405,10 +405,10 @@ Grammar(
405 ), 405 ),
406 "IndexExpr": (), 406 "IndexExpr": (),
407 "FieldExpr": (), 407 "FieldExpr": (),
408 "TryExpr": (), 408 "TryExpr": (options: ["Expr"]),
409 "CastExpr": (), 409 "CastExpr": (options: ["Expr", "TypeRef"]),
410 "RefExpr": (), 410 "RefExpr": (options: ["Expr"]),
411 "PrefixExpr": (), 411 "PrefixExpr": (options: ["Expr"]),
412 "RangeExpr": (), 412 "RangeExpr": (),
413 "BinExpr": (), 413 "BinExpr": (),
414 "String": (), 414 "String": (),
@@ -499,6 +499,7 @@ Grammar(
499 ), 499 ),
500 "LetStmt": ( options: [ 500 "LetStmt": ( options: [
501 ["pat", "Pat"], 501 ["pat", "Pat"],
502 ["type_ref", "TypeRef"],
502 ["initializer", "Expr"], 503 ["initializer", "Expr"],
503 ]), 504 ]),
504 "Condition": ( 505 "Condition": (
@@ -521,7 +522,7 @@ Grammar(
521 ), 522 ),
522 "SelfParam": (), 523 "SelfParam": (),
523 "Param": ( 524 "Param": (
524 options: [ "Pat" ], 525 options: [ "Pat", "TypeRef" ],
525 ), 526 ),
526 "UseItem": ( 527 "UseItem": (
527 options: [ "UseTree" ] 528 options: [ "UseTree" ]