You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: syntax.rs
    path of file: ./repos/rslint/xtask/src/codegen
    
    the code of the file until where you have to start completion: //! Generate SyntaxKind definitions as well as typed AST definitions for nodes and tokens.
//! This is derived from rust-analyzer/xtask/codegen

use crate::{
    ast::{AstSrc, Field, FieldSrc, KindsSrc, AST_SRC, KINDS_SRC},
    codegen::{self, 
    
pub fn generate_syntax(mode: Mode) -> Result<()> {
    let syntax_kinds_file = project_root().join(codegen::SYNTAX_KINDS);
    let syntax_kinds = generate_syntax_kinds(KINDS_SRC)?;
    update(syntax_kinds_file.as_path(), &syntax_kinds, mode)?;

    let ast_tokens_file = project_root().join(codegen::AST_TOKENS);
    let contents = generate_tokens(AST_SRC)?;
    update(ast_tokens_file.as_path(), &contents, mode)?;

    let ast_nodes_file = project_root().join(codegen::AST_NODES);
    let contents = generate_nodes(AST_SRC)?;
    update(ast_nodes_file.as_path(), &contents, mode)?;

    Ok(())
}