| author | |
| committer | |
| log | b0c173910c8131298d9cc74335843fdcf91d4225 |
| tree | 7cdfdd0f18964d7ec3dede0032c73430e90412e4 |
| parent | 4470c3b285523251143a844ca7821d457fdae8af |
| signature | Commit is signed but in an unrecognized format. |
5 files changed, 7 insertions(+), 5 deletions(-)
CHANGELOG.md+2| ... | ... | @@ -1,5 +1,7 @@ |
| 1 | 1 | ## 0.1.7 |
| 2 | 2 | |
| 3 | - feat: allow any expression as a function body | |
| 4 | ||
| 3 | 5 | ## 0.1.6 |
| 4 | 6 | |
| 5 | 7 | - breaking: rename `@js` to `@extern`, considering future backends |
src/cli_compiler.zig+2| ... | ... | @@ -48,6 +48,8 @@ pub fn main() !u8 { |
| 48 | 48 | defer Cli.programArgsFree(alloc, args); |
| 49 | 49 | const opts = arg_config.parse(program_name, args); |
| 50 | 50 | |
| 51 | if (opts.report_trace == true) Report.debug_show_report_trace = true; | |
| 52 | ||
| 51 | 53 | const file_path = try std.fs.path.resolve(alloc, &.{ |
| 52 | 54 | cwd, |
| 53 | 55 | opts.positionals orelse |
src/core/Parse.zig+1-2| ... | ... | @@ -498,8 +498,7 @@ fn parseFnDecl(p: *Parse) Error!NodeIndex { |
| 498 | 498 | else |
| 499 | 499 | null; |
| 500 | 500 | |
| 501 | try p.expectWithoutAdvance(.start_brace); | |
| 502 | const body = try p.parseBlock(); | |
| 501 | const body = try p.parseExpression(.expression); | |
| 503 | 502 | |
| 504 | 503 | const extra = try p.addExtra(Ast.Fn, .{ |
| 505 | 504 | .params = params orelse .empty, |
src/core/Sema.zig+1-1| ... | ... | @@ -1706,7 +1706,7 @@ fn coerceRef(s: *Sema, src: LazyNode, ref: Air.Inst.Ref, to: Type) !Air.Inst.Ref |
| 1706 | 1706 | }, |
| 1707 | 1707 | .int32 => switch (from) { |
| 1708 | 1708 | .int32 => unreachable, // same type handled |
| 1709 | .numeric_literal => unreachable, // must should comptime known | |
| 1709 | .numeric_literal => unreachable, // must be comptime known | |
| 1710 | 1710 | else => {}, |
| 1711 | 1711 | }, |
| 1712 | 1712 | .float => switch (from) { |
test/behavior/inferred_return_type+1-2| ... | ... | @@ -1,8 +1,7 @@ |
| 1 | 1 | let assertEqual = @extern("assertEqual"); |
| 2 | 2 | |
| 3 | fn getString() { | |
| 3 | fn getString() | |
| 4 | 4 | "hello" |
| 5 | } | |
| 6 | 5 | |
| 7 | 6 | fn main { |
| 8 | 7 | let str = getString(); |