Skip to content

Commit 1fe891a

Browse files
add docs for HIGHLIGHT$
1 parent eb5dff5 commit 1fe891a

File tree

433 files changed

+2173
-2117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

433 files changed

+2173
-2117
lines changed

docpages/basic-language-reference/functions/string/04_INDEX.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- \subpage GETPROCNAME
1111
- \subpage GETPROCSTATE
1212
- \subpage GETVAR
13+
- \subpage HIGHLIGHT
1314
- \subpage INKEY
1415
- \subpage INSOCKET
1516
- \subpage LEFT
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
\page HIGHLIGHT HIGHLIGHT$ Function
2+
3+
```basic
4+
HIGHLIGHT$(string-expression)
5+
```
6+
7+
Given a string containing BASIC source, returns a copy with ANSI SGR escape sequences applied for syntax highlighting. Intended for program listings, editors, and tools that render to an ANSI-capable terminal, producing a consistent look-and-feel.
8+
9+
**Notes**
10+
11+
* **Strings** — text between double quotes (`"..."`) is highlighted in **light yellow** from the opening quote to the closing quote. If a closing quote is missing, highlighting continues to the end of the input and is then reset.
12+
* **Comments**
13+
14+
* A single quote (') begins a comment that is highlighted in **dark green** until the end of the input.
15+
* The keyword `REM` (when not inside a string) causes the **entire line** to be treated as a comment and highlighted in **dark green**.
16+
* **Keywords / tokens** — recognised BASIC keywords are highlighted in **light blue** when they are not part of a longer identifier. Boundary detection prevents colouring inside names like `FORTH`. Exceptions: `PROC`, `FN`, and `=` may be adjacent to letters/digits/underscores and will still be highlighted.
17+
* **Built-in functions**
18+
19+
* Integer-returning built-ins are **light green**.
20+
* String-returning built-ins are **light magenta**.
21+
* Real/float-returning built-ins are **light cyan**.
22+
* **Numeric literals** — digits (and a leading unary `+`/`-`) are highlighted in **orange**.
23+
* **Operators & punctuation**`() + - * / = < > , ;` are highlighted in **dark red**.
24+
* **Default text** — rendered in **white**. Colours are reset back to white after each coloured span, and a final reset is appended at the end of the result to prevent “colour leakage” in the caller’s terminal.
25+
26+
**Errors**
27+
28+
* None
29+
30+
**Examples**
31+
32+
```basic
33+
' Strings and a trailing comment
34+
A$ = "PRINT " + CHR$(34) + "hello world" + CHR$(34) + " ' This is an example"
35+
PRINT HIGHLIGHT$(A$)
36+
37+
' Keywords, numbers, and operators
38+
B$ = "FOR I = 1 TO 10 + 8"
39+
PRINT HIGHLIGHT$(B$)
40+
41+
' REM comment colours the whole line as a comment
42+
D$ = "REM this whole line is a comment"
43+
PRINT HIGHLIGHT$(D$)
44+
```
45+
46+
**See also**
47+
48+
* \ref PRINT - display output on the screen
49+
* \ref edit - Text editor

docpages/basic-language-reference/functions/string/REPLACE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
\page REPLACE REPLACE\$ Function
2-
3-
#### REPLACE\$
1+
\page REPLACE REPLACE$ Function
42

53
```basic
64
REPLACE$(haystack-string-expression, needle-string-expression, replacement-string-expression)

docs/ABS.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
9999
<ul>
100100
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="int-funcs.html">Integer Functions</a></li>
101-
<li class="footer">Generated on Wed Sep 10 2025 09:42:33 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
101+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
102102
</ul>
103103
</div>
104104
</body>

docs/ACS.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
100100
<ul>
101101
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
102-
<li class="footer">Generated on Wed Sep 10 2025 09:42:33 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
102+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
103103
</ul>
104104
</div>
105105
</body>

docs/ASC.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
9999
<ul>
100100
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="int-funcs.html">Integer Functions</a></li>
101-
<li class="footer">Generated on Wed Sep 10 2025 09:42:33 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
101+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
102102
</ul>
103103
</div>
104104
</body>

docs/ASN.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
100100
<ul>
101101
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
102-
<li class="footer">Generated on Wed Sep 10 2025 09:42:33 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
102+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
103103
</ul>
104104
</div>
105105
</body>

docs/ATAN.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
100100
<ul>
101101
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
102-
<li class="footer">Generated on Wed Sep 10 2025 09:42:33 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
102+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
103103
</ul>
104104
</div>
105105
</body>

docs/ATAN2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
100100
<ul>
101101
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
102-
<li class="footer">Generated on Wed Sep 10 2025 09:42:33 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
102+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
103103
</ul>
104104
</div>
105105
</body>

docs/AUTOFLIP.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
103103
<ul>
104104
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="keywords.html">Keywords</a></li>
105-
<li class="footer">Generated on Wed Sep 10 2025 09:42:34 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
105+
<li class="footer">Generated on Wed Sep 10 2025 14:52:44 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
106106
</ul>
107107
</div>
108108
</body>

0 commit comments

Comments
 (0)