From bb33f8fc1839284eb853beb06a00c6402e93b35d Mon Sep 17 00:00:00 2001 From: WJKM <54790970+wmentha@users.noreply.github.com> Date: Fri, 22 Sep 2023 21:18:00 +1000 Subject: [PATCH] jakt: Fix signature of default example's main (#5507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a precious version of the language, functions were defined with the `function` keyword. They are now defined with `fn`. Currently, the default example doen't compile. --------- Co-authored-by: Rubén Rincón Blanco --- examples/jakt/default.jakt | 4 ++-- static/modes/jakt-mode.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/jakt/default.jakt b/examples/jakt/default.jakt index 36108b2bf..0f8e0260e 100644 --- a/examples/jakt/default.jakt +++ b/examples/jakt/default.jakt @@ -1,7 +1,7 @@ -function square(num: i32) -> i32 { +fn square(num: i32) -> i32 { return num * num } -function main() throws -> c_int { +fn main() throws -> c_int { return square(num: 3) as! c_int } diff --git a/static/modes/jakt-mode.ts b/static/modes/jakt-mode.ts index 0bb22ba93..d9ddac65a 100644 --- a/static/modes/jakt-mode.ts +++ b/static/modes/jakt-mode.ts @@ -43,6 +43,7 @@ function definition(): monaco.languages.IMonarchLanguage { 'continue', 'throw', 'yield', + 'fn', 'function', 'extern', 'import',