From 5da4b4d928c6507f6e67b2d2a4289eef4b8de0ea Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 12 Jul 2013 14:43:57 -0700 Subject: std/extra: changing XXX to FIXME; cleanup * Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore --- src/libsyntax/parse/parser.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 2b977153b03..135f7162157 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5061,12 +5061,19 @@ impl Parser { } } - pub fn parse_str(&self) -> @str { + pub fn parse_optional_str(&self) -> Option<@str> { match *self.token { token::LIT_STR(s) => { self.bump(); - ident_to_str(&s) + Some(ident_to_str(&s)) } + _ => None + } + } + + pub fn parse_str(&self) -> @str { + match self.parse_optional_str() { + Some(s) => { s } _ => self.fatal("expected string literal") } } -- cgit 1.4.1-3-g733a5