antimony-lang / antimony

The Antimony programming language
https://antimony-lang.github.io/antimony/
Apache License 2.0
138 stars 6 forks source link

c: add support for structs #24

Closed YerinAlexey closed 3 years ago

YerinAlexey commented 3 years ago

Description

This patch adds support for structs in C generator.

ToDo

YerinAlexey commented 3 years ago

Clippy test fails but this doesn't seem related to this PR

garritfra commented 3 years ago

@YerinAlexey it is. format!() needs a .into() in line 290.

YerinAlexey commented 3 years ago

@YerinAlexey it is. format!() needs a .into() in line 290.

No, format!() already returns a String

garritfra commented 3 years ago

Are you sure? I thought it's &str, which is not owned.

YerinAlexey commented 3 years ago

https://doc.rust-lang.org/std/fmt/fn.format.html

YerinAlexey commented 3 years ago

I fixed clippy issues, they were caused because of a wrong return and using format!("{{"} instead of String::from("{")