fn parse_long_string(&mut self, first: Token) -> Result<NodeId, Error> {
      let mut content = String::new();
      if let TokenKind::LongString(s) = first.kind {
         content.push_str(&s);
      } else {
         panic!("first token must be a long string")
      }
      while let TokenKind::LongString(_) = self.lexer.peek_token()?.kind {
         let s = match self.lexer.next_token()?.kind {
            TokenKind::LongString(s) => s,
            _ => unreachable!(),
         };
         content.push('\n');
         content.push_str(&s);
      }
      Ok(self
         .ast
         .build_node(NodeKind::String, ())
         .with_location(first.location)
         .with_string(Rc::from(content))
         .done())
   }
/// Parses a sequence of long string literals.
Parses a sequence of long string literals.
Parses a sequence of long string literals .
fn parse_long_string(&mut self, first: Token) -> Result<NodeId, Error> {
      let mut content = String::new();
      if let TokenKind::LongString(s) = first.kind {
         content.push_str(&s);
      } else {
         panic!("first token must be a long string")
      }
      while let TokenKind::LongString(_) = self.lexer.peek_token()?.kind {
         let s = match self.lexer.next_token()?.kind {
            TokenKind::LongString(s) => s,
            _ => unreachable!(),
         };
         content.push('\n');
         content.push_str(&s);
      }
      Ok(self
         .ast
         .build_node(NodeKind::String, ())
         .with_location(first.location)
         .with_string(Rc::from(content))
         .done())
   }
fn parse_long_string ( & mut self , first : Token ) -> Result < NodeId , Error > { let mut content = String :: new ( ) ; if let TokenKind :: LongString ( s ) = first . kind { content . push_str ( & s ) ; } else { panic ! ( " " ) } while let TokenKind :: LongString ( _ ) = self . lexer . peek_token ( ) ? . kind { let s = match self . lexer . next_token ( ) ? . kind { TokenKind :: LongString ( s ) => s , _ => unreachable ! ( ) , } ; content . push ( '\n' ) ; content . push_str ( & s ) ; } Ok ( self . ast . build_node ( NodeKind :: String , ( ) ) . with_location ( first . location ) . with_string ( Rc :: from ( content ) ) . done ( ) ) }
Parses a sequence of long string literals.
Parses a sequence of long string literals .
&mut self
first
Token