pub fn transpile(code: &str) -> String {
    let mut next_is_then = false;
    // we want to use the same keyword in Koda to represent
    // both "do" and "then". This flag keep tracks
    // of the context and when to transpile to which of the keywords.
    // Note: since Lua does not support "if expressions"/ternary operators,
    // I don't think I need to keep track of the number of "If"'s in a row
    // since it should always be one or zero. 

    lex(&code)
        .iter()
        .map(|token| convert_token(token, &mut next_is_then))
        .collect::<Vec<String>>()
        .join(" ")
}
/// Transpile from Koda code to valid Lua code
Transpile from Koda code to valid Lua code
Transpile from Koda code to valid Lua code
pub fn transpile(code: &str) -> String {
    let mut next_is_then = false;
    // we want to use the same keyword in Koda to represent
    // both "do" and "then". This flag keep tracks
    // of the context and when to transpile to which of the keywords.
    // Note: since Lua does not support "if expressions"/ternary operators,
    // I don't think I need to keep track of the number of "If"'s in a row
    // since it should always be one or zero. 
    lex(&code)
        .iter()
        .map(|token| convert_token(token, &mut next_is_then))
        .collect::<Vec<String>>()
        .join(" ")
}
pub fn transpile ( code : & str ) -> String { let mut next_is_then = false ; // we want to use the same keyword in Koda to represent // both "do" and "then". This flag keep tracks // of the context and when to transpile to which of the keywords. // Note: since Lua does not support "if expressions"/ternary operators, // I don't think I need to keep track of the number of "If"'s in a row // since it should always be one or zero.  lex ( & code ) . iter ( ) . map ( | token | convert_token ( token , & mut next_is_then ) ) . collect :: < Vec < String > > ( ) . join ( " " ) }
Transpile from Koda code to valid Lua code
Transpile from Koda code to valid Lua code
code
&str
code
&str