feat(text): Text.to_float; a void function's return <value> is an error
Text.to_float reads a leading decimal number (strtod), the twin of Text.to_int, for data files. A return with a value in a function that returns nothing now says so where it is, instead of reaching clang as 'store void'. Seed regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f5ab5cf88a
commit
c57eafcacc
8 changed files with 38133 additions and 37958 deletions
|
|
@ -117,6 +117,7 @@ function emit_for(st: Node) -> void {
|
|||
}
|
||||
|
||||
function emit_return(st: Node) -> void {
|
||||
if (st.a != null) and (ret_ty == "void") { perr("a function that returns nothing cannot return a value") }
|
||||
if (st.a != null) {
|
||||
let v = emit_expr(st.a)
|
||||
store_at(llty(ret_ty), coerce_code(v, ret_ty), "%retval")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue