-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Hare's syntax to languages.json, along with an example for the testing system.
- Loading branch information
1 parent
1e3547e
commit ffd0afb
Showing
5 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use fmt; | ||
use strings; | ||
|
||
export type error = !str; | ||
|
||
type example = struct { | ||
number: i64, | ||
error: error, | ||
}; | ||
|
||
fn function(a: i32, b: i32) i32 = a + b; | ||
|
||
export fn main() void = { | ||
for (true) { | ||
break; | ||
}; | ||
|
||
const string = "A string"; // a comment | ||
const another_string = `aaa`; | ||
let iter = strings::iter(string); | ||
|
||
let r = match (strings::next(&iter)) { | ||
case void => return; | ||
case let r: rune => | ||
// comment | ||
yield r; | ||
}; | ||
|
||
switch (r) { | ||
case 'a' => | ||
abort(); | ||
case => | ||
if (r != 'd') fmt::println("not d!")! else fmt::println("d!")!; | ||
}; | ||
|
||
for (let i = 0z; i <= 10; i += 1) { | ||
fmt::print(i, ' ')!; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters