Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser work #61

Merged
merged 5 commits into from
Jan 8, 2024
Merged

Parser work #61

merged 5 commits into from
Jan 8, 2024

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Jan 8, 2024

Depends on #60 because it changes 1 thing there.

With this, we can parse the following program

mod ModuleName {
    import Std.io.{print};

    const MY_CONSTANT: u8 = 2;
    const MY_CONSTANT2: bool = true;
    const MY_CONSTANT3: string = "hello world!";

    pub fn my_func(hello: u64) -> u64 {
        let mut x: u64 = hello / 2;
        x = x + 4;
        x = x - 2;
        x = x % 2;

        match x {
            0 -> return 2,
            1 -> {
                let y: u64 = x * 2;
                return y * 10;
            },
        }

        if x == 2 {
            return 0;
        }

        let lol: u64 = if x == 3 {
            return 4;
        } else {
            return 5;
        };

        print("hello world\nwith newlines and \" escapes ");
        my_func((4 * 2) / 5);

        while x > 0 {
            x = x - 1;
        }

        return x;
    }
}

@edg-l edg-l changed the base branch from main to setup_driver_and_basic_mlir January 8, 2024 16:28
@edg-l edg-l marked this pull request as ready for review January 8, 2024 16:43
Base automatically changed from setup_driver_and_basic_mlir to main January 8, 2024 18:25
@unbalancedparentheses unbalancedparentheses merged commit 529acb8 into main Jan 8, 2024
3 of 4 checks passed
@edg-l edg-l deleted the parser_work branch January 8, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants