调整版本并做测试

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,33 @@
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
JFinal StringDirective - String Directive
"""
from ...Directive import Directive
from ...Env import Env
from ...stat.Scope import Scope
class StringDirective(Directive):
"""String directive for string operations"""
def exec(self, env: Env, scope: Scope, writer) -> None:
"""
Execute string directive
Args:
env: Template environment
scope: Execution scope
writer: Output writer
"""
if self.expr_list:
# Get string value
string_value = self.expr_list.eval(scope)
if string_value is not None:
# Output string
if hasattr(writer, 'write'):
writer.write(str(string_value))
def __repr__(self) -> str:
return "StringDirective()"