Merge branch 'master' into lsp-server

This commit is contained in:
csh
2025-08-29 16:58:14 +08:00
13 changed files with 259 additions and 209 deletions
+32 -8
View File
@@ -1,13 +1,22 @@
// SYNTAX TEST "tsl"
// 字符串,数字,注释
// 注释 TODO
// abc();
a := "string"; // 字符串
b := 123; // 数字
c := 1.23; // 浮点数
a := "字符串函数func()";
// TODO: 注释
{aaaaa TODO}
(* abcdef *)
// 数字
num6 := 123; // 数字
num7 := 1.23; // 浮点数
num1 := 0xAF123;
num2 := 0O12357;
num3 := 0B010111;
num4 := 1.2e-12;
num5 := +3E15;
// 字符串
string1 := '123';
string2 := "func2()";
// 类相关
type MyClass = class
@@ -20,6 +29,8 @@ public
property P1 write param1_ read param1_;
private
[weakref]obj: integer;
[weakref]b: MyClass;
param1_: real;
param2_: array of string;
end;
@@ -30,7 +41,7 @@ end;
function MyClass.Func3(a: real = 1; b: string = "123"): array of string;
begin
obj.P1;
obj.P1.P2;
self.P1;
end
@@ -42,7 +53,8 @@ data.items.count;
// 函数声明
function f(); // 无参数
function f(a, b); // 参数无类型
function f(a: real; b: DD); // 参数有类型
function f(a: real; b: DD); // 参数有类型1
function f(a: real, b: DD); // 参数有类型2
function f(a: real = 1; b: string = "123"; c: number = abc.CONST1): def; // 带返回类型
// 函数调用
@@ -70,3 +82,15 @@ b := array((1, 2), (3, 4));
sql += "update ts_xbcheck result set isvalid = "$status$remark$" where checkid in ('"$array2str
(checkid[(i-1)*len:], "','")$"');\r\n"
sql +=
// tsl-web块
<?tslx>
<HTML>
<Body>
<p>
<?tsl write("TSL Script");?>
</p>
</Body>
</HTML>