Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions src/preppipe/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ def __init__(self, msg : str = '') -> None:
class PPInvalidOperationError(RuntimeError):
def __init__(self, msg : str = '') -> None:
super().__init__(TR_preppipe.invalid_operation.get_with_msg(msg))


class PPCommandHandlerSignatureError(RuntimeError):
"""注册到 resolve_call 的回调函数签名不符合约定(例如多个可按位的业务形参)。"""

def __init__(self, msg: str = "") -> None:
super().__init__(msg)
2 changes: 1 addition & 1 deletion src/preppipe/frontend/commanddocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def get_type_annotation_str_impl(self, a, enumtr_list : list) -> str:
return self._tr_vtype_callexpr.get()
if issubclass(a, (StringLiteral, str)):
return self._tr_vtype_str.get()
if issubclass(a, (FloatLiteral, decimal.Decimal, float)):
if issubclass(a, (FloatLiteral, decimal.Decimal)):
return self._tr_vtype_float.get()
if issubclass(a, (IntLiteral, int)):
return self._tr_vtype_int.get()
Expand Down
245 changes: 208 additions & 37 deletions src/preppipe/frontend/commandsemantics.py

Large diffs are not rendered by default.

358 changes: 357 additions & 1 deletion src/preppipe/frontend/vnmodel/vnast.py

Large diffs are not rendered by default.

491 changes: 466 additions & 25 deletions src/preppipe/frontend/vnmodel/vncodegen.py

Large diffs are not rendered by default.

497 changes: 471 additions & 26 deletions src/preppipe/frontend/vnmodel/vnparser.py

Large diffs are not rendered by default.

881 changes: 863 additions & 18 deletions src/preppipe/frontend/vnmodel/vnutil.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/preppipe/irbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ def get_value_tuple(self) -> tuple[Value]:
def _get_impl(cexpr_cls, ty : ValueType, values : typing.Iterable[Value]):
key_tuple = (cexpr_cls, *values)
return ty.context.get_constexpr_uniquing_dict(cexpr_cls).get_or_create(key_tuple,
lambda: cexpr_cls(init_mode = IRObjectInitMode.CONSTRUCT, context = ty.context, values = values))
lambda: cexpr_cls(init_mode = IRObjectInitMode.CONSTRUCT, context = ty.context, ty = ty, values = values))

class LiteralUniquingDict:
_ty : type
Expand Down Expand Up @@ -2710,6 +2710,7 @@ def export(self, dest_path : str) -> None:
if data := self._data:
data.save(dest_path)
return
# 源与目标扩展名一致时直接拷贝字节流,避免无谓的解码重编码改变文件内容(除非目标格式要求转换)。
# we do file copy iff the source and dest format matches
# otherwise, we open the source file and save it in the destination
_srcname, srcext = os.path.splitext(self.backing_store_path)
Expand Down
495 changes: 488 additions & 7 deletions src/preppipe/renpy/codegen.py

Large diffs are not rendered by default.

Loading