Skip to content

Commit

Permalink
bigint -1 전역상수로 처리 (#35)
Browse files Browse the repository at this point in the history
* -1 상수

* 문서
  • Loading branch information
youknowone authored Apr 4, 2024
1 parent 868e7e6 commit 1601c9b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aheui/aheui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ def get_location(pc, stackok, is_queue, program):


DEBUG = False # debug flag for `rpaheui`
MINUS1 = bigint.fromlong(-1)


class Link(object):
"""Element unit for stack and queue."""

def __init__(self, next, value=bigint.fromlong(-1)):
def __init__(self, next, value=MINUS1):
self.value = value
self.next = next

Expand Down Expand Up @@ -220,10 +221,10 @@ def look(self, length):
def read_utf8(input_buffer=input_buffer):
"""Get a utf-8 character from standard input.
The length of utf-8 character is detectable in first byte.
If decode fails, it means it is a broken character.
Non-utf-8 character input is undefined in aheui.
Let's put -1 in this implementaion.
The length of a UTF-8 character can be detected in the first byte.
If decoding fails, it indicates that the character is broken.
In Aheui, non-UTF-8 character input is undefined.
In this implementation, let's assign -1.
"""
input_buffer.load(1)
head = input_buffer.look(1)
Expand Down

0 comments on commit 1601c9b

Please sign in to comment.