调整版本并做测试

This commit is contained in:
2026-02-27 17:10:54 +08:00
parent fa673138f6
commit 31be9d0e97
77 changed files with 679 additions and 25 deletions

View File

@@ -0,0 +1,46 @@
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
JFinal Directive - Base Directive Class
"""
from typing import Optional
from .expr.ast import ExprList
from .stat.ast.Stat import Stat
class Directive(Stat):
"""Base class for custom directives"""
def __init__(self):
"""Initialize directive"""
super().__init__()
self._expr_list: Optional[ExprList] = None
self._stat: Optional[Stat] = None
@property
def expr_list(self) -> Optional[ExprList]:
"""Get expression list"""
return self._expr_list
@expr_list.setter
def expr_list(self, value: ExprList):
"""Set expression list"""
self._expr_list = value
@property
def stat(self) -> Optional[Stat]:
"""Get nested stat"""
return self._stat
@stat.setter
def stat(self, value: Stat):
"""Set nested stat"""
self._stat = value
def set_expr_list(self, expr_list: ExprList):
"""Set expression list (for parser)"""
self._expr_list = expr_list
def set_stat(self, stat: Stat):
"""Set nested stat (for parser)"""
self._stat = stat