Skip to content

Commit

Permalink
Merge pull request #99 from joseluis/no_std
Browse files Browse the repository at this point in the history
Detect extern main function
  • Loading branch information
fornwall authored Apr 14, 2023
2 parents 490294c + c03647b commit 7b92948
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ pub fn split_input(
toolchain: Option<String>,
) -> MainResult<(String, String)> {
fn contains_main_method(source: &str) -> bool {
let re_shebang: Regex = Regex::new(r"(?m)^ *(pub )?(async )?fn main *\(").unwrap();
let re_shebang: Regex =
Regex::new(r#"(?m)^ *(pub )?(async )?(extern "C" )?fn main *\("#).unwrap();
re_shebang.is_match(source)
}

Expand Down

0 comments on commit 7b92948

Please sign in to comment.