aboutsummaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-01 09:27:31 +0100
committerAleksey Kladov <[email protected]>2018-08-01 09:27:31 +0100
commit37e1625f0139da07c2690b6ee6ca7eae5ebb061a (patch)
tree368d3329e120fc5d76a0595110f7519bb084d70f /tests/data
parent53485030dc49aa7cd66e36c8a1e1abf1bf08020c (diff)
return expr
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/lexer/0011_keywords.rs2
-rw-r--r--tests/data/lexer/0011_keywords.txt2
-rw-r--r--tests/data/parser/inline/0068_return_expr.rs4
-rw-r--r--tests/data/parser/inline/0068_return_expr.txt28
4 files changed, 35 insertions, 1 deletions
diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs
index 22b063567..e6bf64d4d 100644
--- a/tests/data/lexer/0011_keywords.rs
+++ b/tests/data/lexer/0011_keywords.rs
@@ -1,3 +1,3 @@
1fn use struct trait enum impl true false as extern crate 1fn use struct trait enum impl true false as extern crate
2mod pub self super in where for loop while if match const 2mod pub self super in where for loop while if match const
3static mut type ref let else move 3static mut type ref let else move return
diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt
index 7cfc76716..d6a1abe8a 100644
--- a/tests/data/lexer/0011_keywords.txt
+++ b/tests/data/lexer/0011_keywords.txt
@@ -57,4 +57,6 @@ WHITESPACE 1 " "
57ELSE_KW 4 "else" 57ELSE_KW 4 "else"
58WHITESPACE 1 " " 58WHITESPACE 1 " "
59MOVE_KW 4 "move" 59MOVE_KW 4 "move"
60WHITESPACE 1 " "
61RETURN_KW 6 "return"
60WHITESPACE 1 "\n" 62WHITESPACE 1 "\n"
diff --git a/tests/data/parser/inline/0068_return_expr.rs b/tests/data/parser/inline/0068_return_expr.rs
new file mode 100644
index 000000000..5733666b6
--- /dev/null
+++ b/tests/data/parser/inline/0068_return_expr.rs
@@ -0,0 +1,4 @@
1fn foo() {
2 return;
3 return 92;
4}
diff --git a/tests/data/parser/inline/0068_return_expr.txt b/tests/data/parser/inline/0068_return_expr.txt
new file mode 100644
index 000000000..61a075fc1
--- /dev/null
+++ b/tests/data/parser/inline/0068_return_expr.txt
@@ -0,0 +1,28 @@
1FILE@[0; 40)
2 FN_ITEM@[0; 40)
3 FN_KW@[0; 2)
4 NAME@[2; 6)
5 WHITESPACE@[2; 3)
6 IDENT@[3; 6) "foo"
7 PARAM_LIST@[6; 9)
8 L_PAREN@[6; 7)
9 R_PAREN@[7; 8)
10 WHITESPACE@[8; 9)
11 BLOCK_EXPR@[9; 40)
12 L_CURLY@[9; 10)
13 EXPR_STMT@[10; 27)
14 RETURN_EXPR@[10; 21)
15 WHITESPACE@[10; 15)
16 RETURN_KW@[15; 21)
17 SEMI@[21; 22)
18 WHITESPACE@[22; 27)
19 EXPR_STMT@[27; 38)
20 RETURN_EXPR@[27; 36)
21 RETURN_KW@[27; 33)
22 LITERAL@[33; 36)
23 WHITESPACE@[33; 34)
24 INT_NUMBER@[34; 36) "92"
25 SEMI@[36; 37)
26 WHITESPACE@[37; 38)
27 R_CURLY@[38; 39)
28 WHITESPACE@[39; 40)