pub fn first_error(&self) -> Option<(ast::SourceLoc, String)> {
        self.parser.first_error_index().map(|index| {
            let msg = &self.parser.messages()[index];
            (
                ast::SourceLoc {
                    line: msg.coord.line as u32,
                    col: msg.coord.offset as u32 + 1,
                },
                utf8_with_surrogates_to_string_lossy(msg.message.as_slice()),
            )
        })
    }
/// This function is a temporary hack returning the first error.
/// It returns (line, column, error_message) of the first error.
This function is a temporary hack returning the first error.
It returns (line, column, error_message) of the first error.
This function is a temporary hack returning the first error . It returns ( line column error_message ) of the first error .
pub fn first_error(&self) -> Option<(ast::SourceLoc, String)> {
        self.parser.first_error_index().map(|index| {
            let msg = &self.parser.messages()[index];
            (
                ast::SourceLoc {
                    line: msg.coord.line as u32,
                    col: msg.coord.offset as u32 + 1,
                },
                utf8_with_surrogates_to_string_lossy(msg.message.as_slice()),
            )
        })
    }
pub fn first_error ( & self ) -> Option < ( ast :: SourceLoc , String ) > { self . parser . first_error_index ( ) . map ( | index | { let msg = & self . parser . messages ( ) [ index ] ; ( ast :: SourceLoc { line : msg . coord . line as u32 , col : msg . coord . offset as u32 + 1 , } , utf8_with_surrogates_to_string_lossy ( msg . message . as_slice ( ) ) , ) } ) }
This function is a temporary hack returning the first error.
This function is a temporary hack returning the first error .
&self
&self