aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/__init__.py
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-02-24 13:04:40 +0800
committer简律纯 <i@jyunko.cn>2024-02-24 13:04:40 +0800
commit57b2835ecc6c9b30920e929985b9d7cafcb7c457 (patch)
treedf0c1221d4766365c231e8bd02e6d8e7bdb63420 /tests/__init__.py
parent45e2f3631bc8d13dacba57e705c7591e7e707b2a (diff)
downloadTRPGNivis-57b2835ecc6c9b30920e929985b9d7cafcb7c457.tar.gz
TRPGNivis-57b2835ecc6c9b30920e929985b9d7cafcb7c457.zip
chore(project): add ruff deps
chore(lint): format code with ruff chore(project): add tool.ruff format section
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index c9a0e8f..97989dc 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -4,12 +4,14 @@ DIR = dirname(abspath(__file__))
token_dict = {} # 创建一个空字典
-with open(join(DIR, '..', 'psi', 'Grammar', 'Token'), 'r') as file:
+with open(join(DIR, "..", "psi", "Grammar", "Token"), "r") as file:
for line in file:
if line := line.strip():
values = line.split() # 使用空格分割行,得到值列表
code = values[0] # 第一个值为代码
- symbol = values[1] if len(values) > 1 else None # 第二个值为符号,如果没有第二个值,则设置为None
+ symbol = (
+ values[1] if len(values) > 1 else None
+ ) # 第二个值为符号,如果没有第二个值,则设置为None
token_dict[code] = symbol # 将代码和符号添加到字典中
# 将字典中的键值对转换为多个变量及其对应的值
@@ -20,4 +22,4 @@ for code, symbol in token_dict.items():
print(LPAR)
print(RPAR)
print(AWAIT)
-# 其他变量... \ No newline at end of file
+# 其他变量...