cairo-lang-parser 0.1.0

Cairo parser.
Documentation
//! > Test lbrace in if condition

//! > test_comments
// TODO(spapini): Improve diagnostics.

//! > test_function_name
get_diagnostics

//! > cairo_code
fn f() {
    if MyStruct{a: 0} == MyStruct{a: 1} {
    }
}

//! > expected_diagnostics
error: Skipped tokens. Expected: statement.
 --> dummy_file.cairo:2:18
    if MyStruct{a: 0} == MyStruct{a: 1} {
                 ^

//! > ==========================================================================

//! > Test if inside if condition

//! > test_comments
// TODO(spapini): Improve diagnostics.

//! > test_function_name
get_diagnostics

//! > cairo_code
fn f() {
    if 0 == if x {1} else {2} {
    }
}

//! > expected_diagnostics
error: Missing tokens. Expected an expression.
 --> dummy_file.cairo:2:12
    if 0 == if x {1} else {2} {
           ^

error: Skipped tokens. Expected: '{'.
 --> dummy_file.cairo:2:13
    if 0 == if x {1} else {2} {
            ^**^