Skip to content

Commit

Permalink
rpython 경고 warnings 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Apr 5, 2024
1 parent 10c67b7 commit cc0c44a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions aheui/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ def __init__(self, list):
def sort(self):
self.list.sort()

import os
os.write(2, b"[Warning] It is running without rlib/jit.\n")


try:
unichr(0)
Expand Down
4 changes: 3 additions & 1 deletion aheui/aheui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os

from aheui import const as c
from aheui._compat import jit, unichr, ord, _unicode, bigint
from aheui._compat import jit, unichr, ord, _unicode, bigint, PYR
from aheui import compile
from aheui.option import process_options
from aheui.warning import WarningPool
Expand Down Expand Up @@ -493,6 +493,8 @@ def entry_point(argv):
compiler = prepare_compiler(contents, int(str_opt_level), source, aheuic_output, add_debug_info)
outfp = 1 if output == '-' else open_w(output)
if target == 'run':
if not PYR:
warnings.warn(b'no-rpython')
program = Program(compiler.lines, compiler.label_map)
exitcode = mainloop(program, compiler.debug)
elif target in ['asm', 'asm+comment']:
Expand Down
1 change: 1 addition & 0 deletions aheui/warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def format(self, *args):


WARNING_LIST = [
Warning(b'no-rpython', b"[Warning:VirtualMachine] Running without rlib/jit.\n"),
Warning(b'write-utf8-range', b'[Warning:UndefinedBehavior:write-utf8-range] value %x is out of unicode codepoint range.'),
]

Expand Down

0 comments on commit cc0c44a

Please sign in to comment.