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

Parse floats, parse chars and strings with escape codes #84

Merged
merged 5 commits into from
Feb 6, 2024

Conversation

edg-l
Copy link
Collaborator

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

 mod Simple {
    fn main() -> i64 {
        let a: f32 = my_f32(2.0, 4.0);
        let b: f64 = my_f64(2.0, 4.0);
        return 1;
    }

    fn my_f32(x: f32, y: f32) -> f32 {
        let literal: f32 = 2.0;
        let literal2: f32 = 2.;
        let literal3: f32 = .1;
        return x + y + literal2 + literal3;
    }

    fn my_f64(x: f64, y: f64) -> f64 {
        let literal: f64 = 2.0;
        let literal2: f64 = 2.;
        let literal3: f64 = .1;
        return x + y + literal2 + literal3;
    }
}
 mod Simple {
    fn main() -> i64 {
        let a: char = hello_chars('\t');
        return 1;
    }

    fn hello_chars(a: char) -> char {
        let x: char = 'b';
        let newline: char = '\n';

        return x + newline + a;
    }
}

@edg-l edg-l added this to the 0.01 Talc milestone Jan 19, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (35506b6) 69.61% compared to head (871e7df) 69.82%.

Files Patch % Lines
crates/concrete_codegen_mlir/src/codegen.rs 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
+ Coverage   69.61%   69.82%   +0.21%     
==========================================
  Files          28       28              
  Lines        1379     1392      +13     
==========================================
+ Hits          960      972      +12     
- Misses        419      420       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

igaray
igaray previously approved these changes Jan 23, 2024
@edg-l edg-l dismissed igaray’s stale review January 23, 2024 14:23

The merge-base changed after approval.

igaray
igaray previously approved these changes Jan 23, 2024
@igaray igaray dismissed their stale review January 23, 2024 14:23

The merge-base changed after approval.

@unbalancedparentheses
Copy link
Member

let literal3: f32 = .1;
let literal2: f32 = 2.;

Please remove this. We don't want to support too much magic. It should be 0.1

@edg-l
Copy link
Collaborator Author

edg-l commented Jan 23, 2024

let literal3: f32 = .1;
let literal2: f32 = 2.;

Please remove this. We don't want to support too much magic. It should be 0.1

done

Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

azteca1998
azteca1998 previously approved these changes Jan 29, 2024
@jrchatruc
Copy link

The chars.con file was added but no test is running it, add a test for it (also tests should be reading directly from the files in the examples directory)

Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add tests as pointed out by @jrchatruc

@unbalancedparentheses unbalancedparentheses merged commit 53843d8 into main Feb 6, 2024
4 checks passed
@unbalancedparentheses unbalancedparentheses deleted the parse_floats_chars_string_unescape branch February 6, 2024 14:49
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.

7 participants