aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2018-12-20 20:56:28 +0000
committerFlorian Diebold <[email protected]>2018-12-23 12:48:04 +0000
commit3ac605e6876056fa56098231cc2f96553faab8f0 (patch)
tree82294448f696bae2ba640c4fb74dac9b929265a3 /crates/ra_syntax/src/ast
parentd77520fde3c953968beb09a3da80a0e7b17bbc04 (diff)
Add beginnings of type infrastructure
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs44
1 files changed, 38 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index bf056131e..91f27fb26 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -523,7 +523,15 @@ impl<R: TreeRoot<RaTypes>> CastExprNode<R> {
523} 523}
524 524
525 525
526impl<'a> CastExpr<'a> {} 526impl<'a> CastExpr<'a> {
527 pub fn expr(self) -> Option<Expr<'a>> {
528 super::child_opt(self)
529 }
530
531 pub fn type_ref(self) -> Option<TypeRef<'a>> {
532 super::child_opt(self)
533 }
534}
527 535
528// Char 536// Char
529#[derive(Debug, Clone, Copy,)] 537#[derive(Debug, Clone, Copy,)]
@@ -2312,6 +2320,10 @@ impl<'a> Param<'a> {
2312 pub fn pat(self) -> Option<Pat<'a>> { 2320 pub fn pat(self) -> Option<Pat<'a>> {
2313 super::child_opt(self) 2321 super::child_opt(self)
2314 } 2322 }
2323
2324 pub fn type_ref(self) -> Option<TypeRef<'a>> {
2325 super::child_opt(self)
2326 }
2315} 2327}
2316 2328
2317// ParamList 2329// ParamList
@@ -2394,7 +2406,11 @@ impl<R: TreeRoot<RaTypes>> ParenExprNode<R> {
2394} 2406}
2395 2407
2396 2408
2397impl<'a> ParenExpr<'a> {} 2409impl<'a> ParenExpr<'a> {
2410 pub fn expr(self) -> Option<Expr<'a>> {
2411 super::child_opt(self)
2412 }
2413}
2398 2414
2399// ParenType 2415// ParenType
2400#[derive(Debug, Clone, Copy,)] 2416#[derive(Debug, Clone, Copy,)]
@@ -2829,7 +2845,11 @@ impl<R: TreeRoot<RaTypes>> PrefixExprNode<R> {
2829} 2845}
2830 2846
2831 2847
2832impl<'a> PrefixExpr<'a> {} 2848impl<'a> PrefixExpr<'a> {
2849 pub fn expr(self) -> Option<Expr<'a>> {
2850 super::child_opt(self)
2851 }
2852}
2833 2853
2834// RangeExpr 2854// RangeExpr
2835#[derive(Debug, Clone, Copy,)] 2855#[derive(Debug, Clone, Copy,)]
@@ -2940,7 +2960,11 @@ impl<R: TreeRoot<RaTypes>> RefExprNode<R> {
2940} 2960}
2941 2961
2942 2962
2943impl<'a> RefExpr<'a> {} 2963impl<'a> RefExpr<'a> {
2964 pub fn expr(self) -> Option<Expr<'a>> {
2965 super::child_opt(self)
2966 }
2967}
2944 2968
2945// RefPat 2969// RefPat
2946#[derive(Debug, Clone, Copy,)] 2970#[derive(Debug, Clone, Copy,)]
@@ -3088,7 +3112,11 @@ impl<R: TreeRoot<RaTypes>> ReturnExprNode<R> {
3088} 3112}
3089 3113
3090 3114
3091impl<'a> ReturnExpr<'a> {} 3115impl<'a> ReturnExpr<'a> {
3116 pub fn expr(self) -> Option<Expr<'a>> {
3117 super::child_opt(self)
3118 }
3119}
3092 3120
3093// SelfParam 3121// SelfParam
3094#[derive(Debug, Clone, Copy,)] 3122#[derive(Debug, Clone, Copy,)]
@@ -3578,7 +3606,11 @@ impl<R: TreeRoot<RaTypes>> TryExprNode<R> {
3578} 3606}
3579 3607
3580 3608
3581impl<'a> TryExpr<'a> {} 3609impl<'a> TryExpr<'a> {
3610 pub fn expr(self) -> Option<Expr<'a>> {
3611 super::child_opt(self)
3612 }
3613}
3582 3614
3583// TupleExpr 3615// TupleExpr
3584#[derive(Debug, Clone, Copy,)] 3616#[derive(Debug, Clone, Copy,)]