fn visit_var_decl(
        &mut self,
        id: &mut super::Ident,
        expr: &mut Option<Expr>,
        kind: super::VarKind,
    ) -> VisitorResult {
        match expr {
            Some(expr) => self.visit_expr(expr),
            None if kind == VarKind::Fin => {
                let err_kind = SyntaxErrorKind::MissingConstInit {
                    item: Item::new(&id.pos, &id.name),
                };

                Err(SyntaxError::new(err_kind))
            }
            _ => Ok(()),
        }
    }
/// Validate the variable's inital value. If it doesn't have an
/// inital value and its a constant (final) var declaration, then
/// report an error.
Validate the variable's inital value. If it doesn't have an
inital value and its a constant (final) var declaration, then
report an error.
Validate the variable ' s inital value . If it doesn ' t have an inital value and its a constant ( final ) var declaration then report an error .
fn visit_var_decl(
        &mut self,
        id: &mut super::Ident,
        expr: &mut Option<Expr>,
        kind: super::VarKind,
    ) -> VisitorResult {
        match expr {
            Some(expr) => self.visit_expr(expr),
            None if kind == VarKind::Fin => {
                let err_kind = SyntaxErrorKind::MissingConstInit {
                    item: Item::new(&id.pos, &id.name),
                };
                Err(SyntaxError::new(err_kind))
            }
            _ => Ok(()),
        }
    }
fn visit_var_decl ( & mut self , id : & mut super :: Ident , expr : & mut Option < Expr > , kind : super :: VarKind , ) -> VisitorResult { match expr { Some ( expr ) => self . visit_expr ( expr ) , None if kind == VarKind :: Fin => { let err_kind = SyntaxErrorKind :: MissingConstInit { item : Item :: new ( & id . pos , & id . name ) , } ; Err ( SyntaxError :: new ( err_kind ) ) } _ => Ok ( ( ) ) , } }
Validate the variable's inital value.
Validate the variable ' s inital value .
&mut self
id
&mut super::Ident
expr
&mut Option<Expr>
kind
super::VarKind