aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-02-04 09:28:30 +0000
committerAleksey Kladov <[email protected]>2018-02-04 09:28:30 +0000
commit003ea633e9e9fbd3e30aec2c6f33589aa13b000a (patch)
tree29e5405764acd85642119740e56cde2cb2c2eb5b /src/parser/event_parser
parentb072e68ad5bf1687aebd2ff1c7bf327d38a6a2f2 (diff)
Add more inline tests
Diffstat (limited to 'src/parser/event_parser')
-rw-r--r--src/parser/event_parser/grammar/items/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser/event_parser/grammar/items/mod.rs b/src/parser/event_parser/grammar/items/mod.rs
index 5cf2fc39a..6d6fabbd7 100644
--- a/src/parser/event_parser/grammar/items/mod.rs
+++ b/src/parser/event_parser/grammar/items/mod.rs
@@ -25,6 +25,8 @@ fn item(p: &mut Parser) {
25 use_item::use_item(p); 25 use_item::use_item(p);
26 USE_ITEM 26 USE_ITEM
27 } 27 }
28 // test extern_crate
29 // extern crate foo;
28 EXTERN_KW if la == CRATE_KW => { 30 EXTERN_KW if la == CRATE_KW => {
29 extern_crate_item(p); 31 extern_crate_item(p);
30 EXTERN_CRATE_ITEM 32 EXTERN_CRATE_ITEM
@@ -32,14 +34,20 @@ fn item(p: &mut Parser) {
32 EXTERN_KW => { 34 EXTERN_KW => {
33 abi(p); 35 abi(p);
34 match p.current() { 36 match p.current() {
37 // test extern_fn
38 // extern fn foo() {}
35 FN_KW => { 39 FN_KW => {
36 fn_item(p); 40 fn_item(p);
37 FN_ITEM 41 FN_ITEM
38 } 42 }
43 // test extern_block
44 // extern {}
39 L_CURLY => { 45 L_CURLY => {
40 extern_block(p); 46 extern_block(p);
41 EXTERN_BLOCK 47 EXTERN_BLOCK
42 } 48 }
49 // test extern_struct
50 // extern struct Foo;
43 _ => { 51 _ => {
44 item.abandon(p); 52 item.abandon(p);
45 p.error().message("expected `fn` or `{`").emit(); 53 p.error().message("expected `fn` or `{`").emit();