// Note that this does not scan an XHP body
Note that this does not scan an XHP body
Note that this does not scan an XHP body
fn scan_xhp_token(&mut self) -> TokenKind {
        // TODO: HHVM requires that there be no trivia between < and name in an
        // opening tag, but does allow trivia between </ and name in a closing tag.
        // Consider allowing trivia in an opening tag.
        let ch0 = self.peek_char(0);
        if ch0 == INVALID && self.at_end() {
            TokenKind::EndOfFile
        } else if Self::is_name_nondigit(ch0) {
            self.scan_xhp_element_name(false)
        } else {
            match ch0 {
                '{' => {
                    self.advance(1);
                    TokenKind::LeftBrace
                }
                '}' => {
                    self.advance(1);
                    TokenKind::RightBrace
                }
                '=' => {
                    self.advance(1);
                    TokenKind::Equal
                }
                '<' => {
                    if (self.peek_char(1)) == '/' {
                        self.advance(2);
                        TokenKind::LessThanSlash
                    } else {
                        self.advance(1);
                        TokenKind::LessThan
                    }
                }
                '"' => self.scan_xhp_string_literal(),
                '/' => {
                    if (self.peek_char(1)) == '>' {
                        self.advance(2);
                        TokenKind::SlashGreaterThan
                    } else {
                        self.with_error(Errors::error0006);
                        self.advance(1);
                        TokenKind::ErrorToken
                    }
                }
                '>' => {
                    self.advance(1);
                    TokenKind::GreaterThan
                }
                _ => {
                    self.with_error(Errors::error0006);
                    self.advance(1);
                    TokenKind::ErrorToken
                }
            }
        }
    }
fn scan_xhp_token ( & mut self ) -> TokenKind { // TODO: HHVM requires that there be no trivia between < and name in an // opening tag, but does allow trivia between </ and name in a closing tag. // Consider allowing trivia in an opening tag. let ch0 = self . peek_char ( 0 ) ; if ch0 == INVALID && self . at_end ( ) { TokenKind :: EndOfFile } else if Self :: is_name_nondigit ( ch0 ) { self . scan_xhp_element_name ( false ) } else { match ch0 { '{' => { self . advance ( 1 ) ; TokenKind :: LeftBrace } '}' => { self . advance ( 1 ) ; TokenKind :: RightBrace } '=' => { self . advance ( 1 ) ; TokenKind :: Equal } '<' => { if ( self . peek_char ( 1 ) ) == '/' { self . advance ( 2 ) ; TokenKind :: LessThanSlash } else { self . advance ( 1 ) ; TokenKind :: LessThan } } '"' => self . scan_xhp_string_literal ( ) , '/' => { if ( self . peek_char ( 1 ) ) == '>' { self . advance ( 2 ) ; TokenKind :: SlashGreaterThan } else { self . with_error ( Errors :: error0006 ) ; self . advance ( 1 ) ; TokenKind :: ErrorToken } } '>' => { self . advance ( 1 ) ; TokenKind :: GreaterThan } _ => { self . with_error ( Errors :: error0006 ) ; self . advance ( 1 ) ; TokenKind :: ErrorToken } } } }
Note that this does not scan an XHP body
Note that this does not scan an XHP body
&mut self