Compare commits
3 Commits
696618ff1d
...
540d58e86f
| Author | SHA1 | Date |
|---|---|---|
|
|
540d58e86f | |
|
|
a07586d942 | |
|
|
f109316580 |
|
|
@ -20,6 +20,8 @@ public
|
|||
|
||||
property P1 write param1_ read param1_;
|
||||
private
|
||||
[weakref]obj: integer;
|
||||
[weakref]b: MyClass;
|
||||
param1_: real;
|
||||
param2_: array of string;
|
||||
end;
|
||||
|
|
@ -30,7 +32,7 @@ end;
|
|||
|
||||
function MyClass.Func3(a: real = 1; b: string = "123"): array of string;
|
||||
begin
|
||||
obj.P1;
|
||||
obj.P1.P2;
|
||||
self.P1;
|
||||
end
|
||||
|
||||
|
|
@ -70,3 +72,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>
|
||||
|
||||
|
||||
|
|
|
|||
36
vim/tsl.vim
36
vim/tsl.vim
|
|
@ -20,7 +20,7 @@ syn keyword tslPrimitiveType string integer boolean int64 real array
|
|||
|
||||
# 类型系统和面向对象
|
||||
syn keyword tslClassType type class fakeclass new
|
||||
syn keyword tslClassModifier override overload virtual property self inherited
|
||||
syn keyword tslClassModifier override overload virtual property inherited self
|
||||
syn keyword tslAccessModifier public protected private published
|
||||
syn keyword tslConstructor create destroy operator
|
||||
syn keyword tslReferenceModifier weakref autoref
|
||||
|
|
@ -66,15 +66,17 @@ syn keyword tslBoolean false true
|
|||
syn keyword tslNull nil
|
||||
syn keyword tslMathConstant inf nan
|
||||
|
||||
# todo
|
||||
syn keyword tslTodo FIXME NOTE NOTES TODO XXX contained
|
||||
|
||||
# Function definitions
|
||||
syn match tslFuncName '\%(\h\w*\.\)\?\h\w*' contained nextgroup=tslFuncParams skipwhite contains=tslTypeNameInFunc,tslDotInFunc,tslFuncNamePart
|
||||
syn match tslFuncName '\%(\h\w*\.\)\?\h\w*' contained nextgroup=tslFuncParams skipwhite contains=tslTypeNameInFunc,tslDotInFunc
|
||||
syn match tslTypeNameInFunc '\h\w*\ze\.\h\w*' contained
|
||||
syn match tslDotInFunc '\.' contained
|
||||
syn match tslFuncName '\.\@<=\h\w*' contained
|
||||
|
||||
syn region tslFuncParams
|
||||
\ matchgroup=Delimiter
|
||||
\ start='('
|
||||
\ end=')'
|
||||
\ contained
|
||||
|
|
@ -87,12 +89,8 @@ syn match tslReturnType ':\s*[^;]*' contained contains=tslColon
|
|||
syn match tslParamSep '[;,]' contained
|
||||
syn match tslColon ':' contained
|
||||
|
||||
syn match tslVarDecl '\(?\s\)\@<!\h\w\s:=\@!\s[^;?];' contains=tslVarName,tslVarType
|
||||
syn match tslVarName '\(?\s\)\@<!\h\w\ze\s:=\@!' contained
|
||||
syn match tslVarType ':=\@!\s[^;?]' contained contains=tslColon
|
||||
|
||||
# 匹配完整的属性链
|
||||
syn match tslPropertyChain '\h\w*\%(\.\h\w*\)\+' contains=tslObjectName,tslPropertyDot,tslPropertyName
|
||||
# Property chain
|
||||
syn match tslPropertyChain '\h\w*\%(\.\h\w*\)\+\>' contains=tslObjectName,tslPropertyDot,tslPropertyName
|
||||
syn match tslObjectName '\h\w*\ze\.\h\w*' contained
|
||||
syn match tslPropertyDot '\.' contained
|
||||
syn match tslPropertyName '\.\@<=\h\w*\%(\ze\.\|\ze\s*[^(]\|\ze\s*$\)' contained
|
||||
|
|
@ -107,7 +105,7 @@ syn region tslFuncCall
|
|||
\ contains=tslFuncCallName,tslFuncCall,tslNamedParam,tslPositionalParam,tslString,tslRawString,tslNumber,tslIdentifier,tslOperator,tslParamSep
|
||||
\ transparent
|
||||
|
||||
syn match tslNamedParam '\h\w*\s*:\s*[^;,)]*' contained
|
||||
syn match tslNamedParam '\%((\|;\s*\)\zs\h\w*\s*:\s*[^;,)]*' contained
|
||||
\ contains=tslParamName,tslParamColon,tslParamValue
|
||||
|
||||
syn match tslParamName '\h\w*\ze\s*:' contained
|
||||
|
|
@ -118,8 +116,21 @@ syn match tslParamValue ':\s*\zs[^;,)]*' contained
|
|||
syn match tslPositionalParam '[^;,():]*' contained
|
||||
\ contains=tslString,tslNumber,tslIdentifier,tslOperator,tslFuncCall,tslFuncCallName
|
||||
|
||||
syn match tslParamSep '[;,]' contained
|
||||
# Variable declaration
|
||||
syn match tslVarDeclWithTag '\]\@<=\s*\h\w*\ze\s*:\%(=\)\@!'
|
||||
\ nextgroup=tslVarTypeDecl skipwhite
|
||||
\ contains=tslVarName
|
||||
|
||||
syn match tslVarDeclStart '\%(^\s*\|;\s*\)\zs\h\w*\ze\s*:\%(=\)\@!'
|
||||
\ nextgroup=tslVarTypeDecl skipwhite
|
||||
\ contains=tslVarName
|
||||
|
||||
syn match tslVarName '\h\w*' contained
|
||||
syn region tslVarTypeDecl
|
||||
\ matchgroup=tslVarDelimiter start=':\%(=\)\@!' end=';'
|
||||
\ contained keepend oneline
|
||||
\ contains=tslVarType
|
||||
syn match tslVarType '[^;]*' contained
|
||||
|
||||
# Operators and delimiters
|
||||
syn match tslOperator '[+\-*/<>=!&|^~%]'
|
||||
|
|
@ -144,6 +155,7 @@ syn match tslNumber '\<\d\+[eE][+-]\=\d\+[jJ]\=\>'
|
|||
syn match tslNumber '\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@='
|
||||
syn match tslNumber '\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>'
|
||||
|
||||
|
||||
# Highlight links
|
||||
hi def link tslProgramStructure Statement
|
||||
hi def link tslModuleStructure Statement
|
||||
|
|
@ -179,8 +191,8 @@ hi def link tslNull Constant
|
|||
hi def link tslMathConstant Number
|
||||
|
||||
# 其他元素的高亮链接保持不变
|
||||
hi def link tslClassName Type
|
||||
hi def link tslDot Operator
|
||||
hi def link tslObjectName Type
|
||||
hi def link tslPropertyDot Operator
|
||||
hi def link tslPropertyName Special
|
||||
|
||||
hi def link tslFuncName Function
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
Notable changes to the `TSL` extension will be documented in thio file.
|
||||
|
||||
## [2.3.1]: 2025-07-10
|
||||
|
||||
- 修复:关键字`initialization`拼写错误
|
||||
|
||||
## [2.3.0]: 2025-07-03
|
||||
|
||||
- 修改插件名为`tsl-tools`
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
cp ../lsp-server/build/arch/tsl-server ./bin/tsl-server
|
||||
cp ../lsp-server/build/msys2/tsl-server.exe ./bin/tsl-server.exe
|
||||
npx vsce package
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "tsl-tools",
|
||||
"displayName": "TSL",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"description": "VSCode extension for TSL, with syntax highlighting, code completion, and formatting",
|
||||
"publisher": "csh",
|
||||
"homepage": "https://git.mytsl.cn/csh/tsl-devkit",
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@
|
|||
"patterns": [
|
||||
{
|
||||
"name": "keyword.control.program-structure.tsl",
|
||||
"match": "(?i)\\b(program|function|procedure|unit|uses|implementation|interface|initalization|finalization)\\b"
|
||||
"match": "(?i)\\b(program|function|procedure|unit|uses|implementation|interface|initialization|finalization)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.control.interface.tsl",
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue