Skip to content

Commit

Permalink
Close #17, add æœ
Browse files Browse the repository at this point in the history
  • Loading branch information
bigyihsuan committed Jun 23, 2020
1 parent 6c78f2a commit 964f2dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Execute the IPEL code by navigating to the repository folder and running `interp
```
$ python3 interpreter.py [options] (codeFile | code)
```
or
```
$ ./interpreter.py [options] (codeFile | code)
```

`codeFile` is any file that contains IPEL code.
`code` is a string that contains IPEL code.
Expand Down
12 changes: 7 additions & 5 deletions src/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ def evaluate(lex, lab, debugmode, unvoiced, voiced, executionStack, currentStack
elif type(con) in [list]:
truthy = con != []
ep += 1 if truthy else 0
# loop index getters and setters
elif lex[ep].lexeme == "e":
if numLoops > 0:
# loop index and limit getters and setters
elif lex[ep].lexeme == "e" and len(executionStack) > 0:
currentStack.append(executionStack[-1])
elif lex[ep].lexeme == "ø":
if numLoops > 0:
elif lex[ep].lexeme == "ø" and len(executionStack) > 0:
executionStack[-1] = currentStack.pop()
elif lex[ep].lexeme == "æ" and len(executionStack) > 1:
currentStack.append(executionStack[-2])
elif lex[ep].lexeme == "œ" and len(executionStack) > 1:
executionStack[-2] = currentStack.pop()
# voicing
elif lex[ep].lexeme == "ɸ":
currentStack = unvoiced
Expand Down
2 changes: 1 addition & 1 deletion src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ def convert_base(s, base=10):
integer = digits[i[1]]
if integer >= base: raise ValueError
ret += base**-(i[0] + 1) * integer
return ret
return ret

0 comments on commit 964f2dd

Please sign in to comment.