From 631e4b044481ae23e40951ebf707b02d44db9daf Mon Sep 17 00:00:00 2001
From: Jorge Aparicio <jorge@japaric.io>
Date: Thu, 20 Jul 2017 22:15:09 -0500
Subject: [PATCH] change the syntax of the top `resources` to look like static
 variables

---
 src/parse.rs | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/parse.rs b/src/parse.rs
index 7c1a813..34eccd4 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -269,11 +269,21 @@ fn statics(tts: &mut Peekable<Iter<TokenTree>>) -> Result<Statics> {
 
         let mut tts = tts.iter();
         while let Some(tt) = tts.next() {
-            let ident = if let &TokenTree::Token(Token::Ident(ref id)) = tt {
-                id
-            } else {
-                bail!("expected Ident, found {:?}", tt);
-            };
+            match tt {
+                &TokenTree::Token(Token::Ident(ref id))
+                    if id.as_ref() == "static" => {}
+                _ => {
+                    bail!("expected keyword `static`, found {:?}", tt);
+                }
+            }
+
+            let tt = tts.next();
+            let ident =
+                if let Some(&TokenTree::Token(Token::Ident(ref id))) = tt {
+                    id
+                } else {
+                    bail!("expected Ident, found {:?}", tt);
+                };
 
             ensure!(
                 !statics.contains_key(ident),
-- 
GitLab