fn handle_macro_definition(&mut self, define_span: Span) -> Result<Macro, DiagBuilder2> {
        let mut all_span = define_span;

        // Consume the macro name.
        let (name, name_span) = match self.try_eat_name() {
            Some(x) => x,
            None => {
                return Err(
                    DiagBuilder2::fatal("expected macro name after \"`define\"").span(define_span)
                );
            }
        };
        all_span.expand(define_span);
        let mut makro = Macro::new(name, name_span);

        // NOTE: No whitespace is allowed after the macro name such that
        // the preprocessor does not mistake the a in "`define FOO (a)"
        // for a macro argument.

        makro.args = self.handle_macro_definition_args()?;

        // Skip whitespace between the macro parameters and definition.
        self.skip_whitespace();

        // Consume the macro definition up to the next newline not preceded
        // by a backslash, ignoring comments, whitespace and newlines.
        loop {
            match self.token {
                Some((Newline, _)) => {
                    self.bump();
                    break;
                }
                // Some((Whitespace, _)) => self.bump(),
                // Some((Comment, _)) => self.bump(),
                Some((Symbol('\\'), _)) => {
                    self.bump();
                    match self.token {
                        Some((Newline, _)) => self.bump(),
                        _ => (),
                    };
                }
                Some(x) => {
                    makro.body.push(x);
                    self.bump();
                }
                None => break,
            }
        }
        Ok(makro)
    }
// Parse the macro definition following a '`define' directive.
Parse the macro definition following a '`define' directive.
Parse the macro definition following a ' ` define ' directive .
fn handle_macro_definition(&mut self, define_span: Span) -> Result<Macro, DiagBuilder2> {
        let mut all_span = define_span;
        // Consume the macro name.
        let (name, name_span) = match self.try_eat_name() {
            Some(x) => x,
            None => {
                return Err(
                    DiagBuilder2::fatal("expected macro name after \"`define\"").span(define_span)
                );
            }
        };
        all_span.expand(define_span);
        let mut makro = Macro::new(name, name_span);
        // NOTE: No whitespace is allowed after the macro name such that
        // the preprocessor does not mistake the a in "`define FOO (a)"
        // for a macro argument.
        makro.args = self.handle_macro_definition_args()?;
        // Skip whitespace between the macro parameters and definition.
        self.skip_whitespace();
        // Consume the macro definition up to the next newline not preceded
        // by a backslash, ignoring comments, whitespace and newlines.
        loop {
            match self.token {
                Some((Newline, _)) => {
                    self.bump();
                    break;
                }
                // Some((Whitespace, _)) => self.bump(),
                // Some((Comment, _)) => self.bump(),
                Some((Symbol('\\'), _)) => {
                    self.bump();
                    match self.token {
                        Some((Newline, _)) => self.bump(),
                        _ => (),
                    };
                }
                Some(x) => {
                    makro.body.push(x);
                    self.bump();
                }
                None => break,
            }
        }
        Ok(makro)
    }
fn handle_macro_definition ( & mut self , define_span : Span ) -> Result < Macro , DiagBuilder2 > { let mut all_span = define_span ; // Consume the macro name. let ( name , name_span ) = match self . try_eat_name ( ) { Some ( x ) => x , None => { return Err ( DiagBuilder2 :: fatal ( " \" \" " ) . span ( define_span ) ) ; } } ; all_span . expand ( define_span ) ; let mut makro = Macro :: new ( name , name_span ) ; // NOTE: No whitespace is allowed after the macro name such that // the preprocessor does not mistake the a in "`define FOO (a)" // for a macro argument. makro . args = self . handle_macro_definition_args ( ) ? ; // Skip whitespace between the macro parameters and definition. self . skip_whitespace ( ) ; // Consume the macro definition up to the next newline not preceded // by a backslash, ignoring comments, whitespace and newlines. loop { match self . token { Some ( ( Newline , _ ) ) => { self . bump ( ) ; break ; } // Some((Whitespace, _)) => self.bump(), // Some((Comment, _)) => self.bump(), Some ( ( Symbol ( '\\' ) , _ ) ) => { self . bump ( ) ; match self . token { Some ( ( Newline , _ ) ) => self . bump ( ) , _ => ( ) , } ; } Some ( x ) => { makro . body . push ( x ) ; self . bump ( ) ; } None => break , } } Ok ( makro ) }
Parse the macro definition following a '`define' directive.
Parse the macro definition following a ' ` define ' directive .
&mut self
define_span
Span
&mut self
define_span
Span