8000 typo: mispelled `PRECEDENCE` by Oppen · Pull Request #17 · Lartu/katalyn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

typo: mispelled PRECEDENCE #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import os

VERSION = "0.1.0"
OPERATOR_PRESEDENCE = ("*", "^", "/", "%", "//", "+", "&", "-", "::", "!", "<", ">", "<=", ">=", "<>", "!=", "=", "||", "&&")
OPERATOR_PRECEDENCE = ("*", "^", "/", "%", "//", "+", "&", "-", "::", "!", "<", ">", "<=", ">=", "<>", "!=", "=", "||", "&&")
LOOP_TAGS = ("while", "until", "for")
NON_DEF_BLOCK_TAGS = ("if", "unless", "while", "until")
ARGS_VAR = "$_"
Expand Down Expand Up @@ -601,7 +601,7 @@ def lex_tokens(tokenized_lines: List[List[Token]]) -> List[List[Token]]:
token.type = LexType.INTEGER
elif is_float(token.value):
token.type = LexType.FLOAT
elif token.value in OPERATOR_PRESEDENCE:
elif token.value in OPERATOR_PRECEDENCE:
token.type = LexType.OPERATOR
elif is_valid_identifier(token.value):
token.type = LexType.WORD
Expand Down Expand Up @@ -663,7 +663,7 @@ def compile_expression(expr_tokens: List[Token], discard_return_value: bool = Fa
if operator is None:
operator = token
else:
if OPERATOR_PRESEDENCE.index(operator.value) <= OPERATOR_PRESEDENCE.index(token.value):
if OPERATOR_PRECEDENCE.index(operator.value) <= OPERATOR_PRECEDENCE.index(token.value):
left_side_tokens.append(operator)
left_side_tokens += right_side_tokens
right_side_tokens = []
Expand Down
0