From 248acc070c1178bc5a3173e90a596bd111ab7ea3 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Wed, 3 Apr 2024 16:22:09 +0900 Subject: [PATCH] =?UTF-8?q?bigint=20=EB=B9=8C=EB=93=9C=EB=A5=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 2 +- aheui/_compat.py | 5 ++++- aheui/aheui.py | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dc9197b..d30743d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -64,4 +64,4 @@ jobs: - name: Test with snippets run: | cd "$GITHUB_WORKSPACE/snippets" - AHEUI="$GITHUB_WORKSPACE/rpaheui-c" ./test.sh --disable logo integer + AHEUI="$GITHUB_WORKSPACE/rpaheui-c" ./test.sh diff --git a/aheui/_compat.py b/aheui/_compat.py index c7a450e..9057ac7 100644 --- a/aheui/_compat.py +++ b/aheui/_compat.py @@ -4,9 +4,12 @@ try: from rpython.rlib import jit from rpython.rlib.listsort import TimSort - TRACE_LIMIT = jit.PARAMETERS['trace_limit'] + + RPYTHON = True except ImportError: """Python compatibility.""" + RPYTHON = False + def omnipotent(*args, **kw): return args and args[0] diff --git a/aheui/aheui.py b/aheui/aheui.py index 1a4e0d7..56f8553 100644 --- a/aheui/aheui.py +++ b/aheui/aheui.py @@ -6,10 +6,13 @@ import os from aheui import const as c -from aheui._compat import jit, unichr, ord, _unicode +from aheui._compat import jit, unichr, ord, _unicode, RPYTHON from aheui import _argparse from aheui import compile -from aheui.int import smallint as bigint # import `bigint` to enable bigint +if RPYTHON: + from aheui.int import bigint # Enable bigint in rpython build +else: + from aheui.int import smallint as bigint # smallint or python support def get_location(pc, stackok, is_queue, program):