aboutsummaryrefslogtreecommitdiff
path: root/plugin/examples
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-21 10:37:17 +0000
committer_ov4 <ov4@ov4.org>2026-10-21 10:37:17 +0000
commit75c0e28e3d56878dbd492cb0c6d6bf341f9e6de7 (patch)
tree2b5fc43cbdcada966ae1ac85569b7f0eff5f51de /plugin/examples
parentaf6bb061ff447f860c514b60202c3192ceec952b (diff)
feat(plugin): highlight type names and template calls
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'plugin/examples')
-rw-r--r--plugin/examples/highlighting.cps19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin/examples/highlighting.cps b/plugin/examples/highlighting.cps
index f80fd8f..10d93d8 100644
--- a/plugin/examples/highlighting.cps
+++ b/plugin/examples/highlighting.cps
@@ -56,3 +56,22 @@ CASE OF Index
2 TO Limit : OUTPUT "In range"
OTHERWISE : OUTPUT "Other"
ENDCASE
+
+TEMPLATE <T>
+FUNCTION _echo(Value : T) RETURNS T
+ RETURN Value
+ENDFUNCTION
+OUTPUT _echo<INTEGER>(Limit)
+
+CLASS Counter
+ PRIVATE Value : INTEGER
+ PUBLIC PROCEDURE Add(Amount : INTEGER)
+ this.Value <- this.Value + Amount
+ ENDPROCEDURE
+ PUBLIC FUNCTION Get() RETURNS INTEGER
+ RETURN this.Value
+ ENDFUNCTION
+ENDCLASS
+DECLARE Count : Counter
+CALL Count.Add(Limit)
+OUTPUT Count.Get()