Skip to content

Commit

Permalink
git grep self.hosted
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 21, 2025
1 parent 647c8b5 commit 16c807c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions broken_tests/README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tests in this directory fail if they are moved into the tests folder.
This is because the self-hosted compiler doesn't analyze the CFGs.
This is because the compiler doesn't analyze the CFGs.

The analysis code exists, but it's written in C, because it used to be a
part of what's now the bootstrap compiler. It's in simplify_cfg.c.
part of the old Jou compiler written in C. It's in simplify_cfg.c.

See issue #566.
11 changes: 2 additions & 9 deletions compiler/tokenizer.jou
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ def is_operator_byte(c: byte) -> bool:
return c != '\0' and strchr("=<>!.,()[]{};:+-*/&%|", c) != NULL

def is_keyword(word: byte*) -> bool:
# This keyword list is in 3 places. Please keep them in sync:
# - the Jou compiler written in C
# - self-hosted compiler
# - syntax documentation
# Please update the syntax documentation if you add keywords
keywords = [
"import", "def", "declare", "class", "union", "enum", "global",
"return", "if", "elif", "else", "while", "for", "pass", "break", "continue",
Expand Down Expand Up @@ -385,11 +382,7 @@ class Tokenizer:

def read_operator(self) -> byte[100]:
operators = [
# This list of operators is in 3 places. Please keep them in sync:
# - the Jou compiler written in C
# - self-hosted compiler
# - syntax documentation
#
# Please update the syntax documentation if you add new operators.
# Longer operators are first, so that '==' does not tokenize as '=' '='
"...", "===", "!==",
"==", "!=", "->", "<=", ">=", "++", "--", "+=", "-=", "*=", "/=", "%=", "&&", "||",
Expand Down
2 changes: 1 addition & 1 deletion stdlib/_assert_fail.jou
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ declare exit(status: int) -> noreturn

@public
def _jou_assert_fail(assertion: byte*, path: byte*, lineno: int) -> noreturn:
# TODO: print to stderr, when self-hosted compiler supports it
# TODO: print to stderr
printf("Assertion '%s' failed in file \"%s\", line %d.\n", assertion, path, lineno)
exit(1)

0 comments on commit 16c807c

Please sign in to comment.