Skip to content

Commit 1329257

Browse files
RESTRICT/DERESTRICT security boundary
1 parent 755ad48 commit 1329257

140 files changed

Lines changed: 1676 additions & 664 deletions

File tree

Some content is hidden

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

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docpages/basic-language-reference/keywords/00_INDEX.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ The following parameter types are used throughout this documentation:
7272
* \subpage DATASET
7373
* \subpage DEF
7474
* \subpage DELETE
75+
* \subpage DERESTRICT
7576
* \subpage DIM
7677
* \subpage ELSE
7778
* \subpage ENDIF
@@ -127,6 +128,7 @@ The following parameter types are used throughout this documentation:
127128
* \subpage RECTANGLE
128129
* \subpage REDIM
129130
* \subpage REM
131+
* \subpage RESTRICT
130132
* \subpage REPEAT
131133
* \subpage RESTORE
132134
* \subpage RETURN
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
\page DERESTRICT DERESTRICT Keyword
2+
3+
```basic
4+
DERESTRICT keyword-or-function[, keyword-or-function...]
5+
```
6+
7+
Removes one or more previously applied restrictions from the child restriction set.
8+
9+
After a restriction is removed, future child programs created from the current interpreter context are again permitted to use those keywords or built-in functions.
10+
11+
### Notes
12+
13+
`DERESTRICT` modifies the set of restrictions that will be passed to child interpreter contexts. It does not affect restrictions already active in existing child programs.
14+
15+
Each item must be the name of a valid BASIC keyword or built-in function.
16+
17+
Multiple items may be removed in a single statement by separating them with commas.
18+
19+
If a restriction is removed, it simply ceases to be inherited by future child contexts.
20+
21+
### Errors
22+
23+
An error is raised if:
24+
25+
* no keyword or built-in function is provided
26+
* a named item is not a valid keyword or built-in function
27+
* no restrictions exist to remove from
28+
* a named item was not previously restricted
29+
30+
### Examples
31+
32+
```basic
33+
DERESTRICT IF
34+
```
35+
36+
```basic
37+
DERESTRICT OPENIN, GETNAMECOUNT
38+
```
39+
40+
```basic
41+
RESTRICT PRINT, INPUT
42+
DERESTRICT INPUT
43+
44+
CHAIN "/programs/untrusted"
45+
```
46+
47+
### See also
48+
49+
\ref RESTRICT "RESTRICT", \ref CHAIN "CHAIN", \ref PROC "PROC", \ref FN "FN"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
\page RESTRICT RESTRICT Keyword
2+
3+
```basic
4+
RESTRICT keyword-or-function[, keyword-or-function...]
5+
```
6+
7+
Restricts one or more BASIC keywords or built-in functions for any child program created from the current interpreter context.
8+
9+
Once restricted, those keywords or built-in functions cannot be used by child programs inheriting the restriction set. If a child program attempts to use one, execution stops with an error.
10+
11+
### Notes
12+
13+
`RESTRICT` affects child interpreter contexts, not the current program.
14+
15+
Each item must be the name of a valid BASIC keyword or built-in function.
16+
17+
Multiple items may be restricted in a single statement by separating them with commas.
18+
19+
Restrictions are inherited when passed to a child context. A child may also apply further restrictions to its own descendants.
20+
21+
To remove a restriction from the child restriction set, use `DERESTRICT`.
22+
23+
### Errors
24+
25+
An error is raised if:
26+
27+
* no keyword or built-in function is provided
28+
* a named item is not a valid keyword or built-in function
29+
* memory allocation fails while storing the restriction
30+
31+
A child program that attempts to use a restricted keyword or built-in function will also raise an error.
32+
33+
### Examples
34+
35+
```basic
36+
RESTRICT IF
37+
```
38+
39+
```basic
40+
RESTRICT OPENIN, GETNAMECOUNT, VDU
41+
```
42+
43+
```basic
44+
RESTRICT PRINT
45+
46+
CHAIN "/programs/untrusted"
47+
```
48+
49+
### See also
50+
51+
\ref DERESTRICT "DERESTRICT", \ref CHAIN "CHAIN", \ref PROC "PROC", \ref FN "FN"

docs/DERESTRICT.html

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=11">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>Retro Rocket OS: DERESTRICT Keyword</title>
8+
<link href="tabs.css" rel="stylesheet" type="text/css">
9+
<script type="text/javascript" src="jquery.js"></script>
10+
<script type="text/javascript" src="dynsections.js"></script>
11+
<script type="text/javascript" src="clipboard.js"></script>
12+
<link href="navtree.css" rel="stylesheet" type="text/css"/>
13+
<script type="text/javascript" src="navtreedata.js"></script>
14+
<script type="text/javascript" src="navtree.js"></script>
15+
<script type="text/javascript" src="cookie.js"></script>
16+
<link href="search/search.css" rel="stylesheet" type="text/css"/>
17+
<script type="text/javascript" src="search/searchdata.js"></script>
18+
<script type="text/javascript" src="search/search.js"></script>
19+
<meta name="title" content="DERESTRICT Keyword - Retro Rocket OS">
20+
<meta name="description" content="A small operating system in the spirit of the 1980s micros. A system you can actually understand, not just use.">
21+
<meta name="author" content="Retro Rocket Developers">
22+
<meta name="robots" content="index, follow">
23+
<link rel="canonical" href="https://retrorocket.dev/">
24+
<meta name="theme-color" content="#0b0f14">
25+
<link rel="icon" href="rr.png">
26+
<meta property="og:locale" content="en_GB">
27+
<meta property="og:title" content="DERESTRICT Keyword - Retro Rocket OS">
28+
<meta property="og:description" content="A small operating system in the spirit of the 1980s micros. A system you can actually understand, not just use.">
29+
<meta property="og:type" content="website">
30+
<meta property="og:url" content="https://retrorocket.dev/">
31+
<meta property="og:image" content="https://retrorocket.dev/leader4.png">
32+
<meta property="og:image:alt" content="Retro Rocket OS running on a retro-style desktop">
33+
<meta property="og:site_name" content="Retro Rocket OS">
34+
<meta name="twitter:card" content="summary_large_image">
35+
<meta name="twitter:title" content="DERESTRICT Keyword - Retro Rocket OS">
36+
<meta name="twitter:description" content="A small operating system in the spirit of the 1980s micros. A system you can actually understand, not just use.">
37+
<meta name="twitter:image" content="https://retrorocket.dev/leader4.png">
38+
<link rel="preload" as="image" href="https://retrorocket.dev/leader4.png">
39+
<script type="application/ld+json">
40+
{
41+
"@context": "https://schema.org",
42+
"@type": "SoftwareApplication",
43+
"name": "Retro Rocket OS",
44+
"operatingSystem": "x86-64",
45+
"applicationCategory": "OperatingSystem",
46+
"description": "A small operating system in the spirit of the 1980s micros. A system you can actually understand, not just use.",
47+
"url": "https://retrorocket.dev/"
48+
}
49+
</script>
50+
<link href="doxygen.css" rel="stylesheet" type="text/css">
51+
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
52+
<link href="style.css" rel="stylesheet" type="text/css"/>
53+
</head>
54+
<body>
55+
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
56+
<div id="titlearea">
57+
<table cellspacing="0" cellpadding="0">
58+
<tbody>
59+
<tr id="projectrow">
60+
<td id="projectlogo"><img alt="Logo" src="rr.png"></td>
61+
<td id="projectalign">
62+
<div id="projectname">Retro Rocket OS</div>
63+
</td>
64+
</tr>
65+
</tbody>
66+
</table>
67+
</div>
68+
<!-- end header part -->
69+
<!-- Generated by Doxygen 1.14.0 -->
70+
<script type="text/javascript">
71+
var searchBox = new SearchBox("searchBox", "search/",'.html');
72+
</script>
73+
<script type="text/javascript">
74+
$(function() { codefold.init(); });
75+
</script>
76+
<script type="text/javascript" src="menudata.js"></script>
77+
<script type="text/javascript" src="menu.js"></script>
78+
<script type="text/javascript">
79+
$(function() {
80+
initMenu('',true,false,'search.php','Search',true);
81+
$(function() { init_search(); });
82+
});
83+
</script>
84+
<div id="main-nav"></div>
85+
</div><!-- top -->
86+
<div id="side-nav" class="ui-resizable side-nav-resizable">
87+
<div id="nav-tree">
88+
<div id="nav-tree-contents">
89+
<div id="nav-sync" class="sync"></div>
90+
</div>
91+
</div>
92+
<div id="splitbar" style="-moz-user-select:none;"
93+
class="ui-resizable-handle">
94+
</div>
95+
</div>
96+
<script type="text/javascript">
97+
$(function(){initNavTree('DERESTRICT.html','',''); });
98+
</script>
99+
<div id="container">
100+
<div id="doc-content">
101+
<!-- window showing the filter options -->
102+
<div id="MSearchSelectWindow"
103+
onmouseover="return searchBox.OnSearchSelectShow()"
104+
onmouseout="return searchBox.OnSearchSelectHide()"
105+
onkeydown="return searchBox.OnSearchSelectKey(event)">
106+
</div>
107+
108+
<!-- iframe showing the search results (closed by default) -->
109+
<div id="MSearchResultsWindow">
110+
<div id="MSearchResults">
111+
<div class="SRPage">
112+
<div id="SRIndex">
113+
<div id="SRResults"></div>
114+
<div class="SRStatus" id="Loading">Loading...</div>
115+
<div class="SRStatus" id="Searching">Searching...</div>
116+
<div class="SRStatus" id="NoMatches">No Matches</div>
117+
</div>
118+
</div>
119+
</div>
120+
</div>
121+
122+
<div><div class="header">
123+
<div class="headertitle"><div class="title">DERESTRICT Keyword </div></div>
124+
</div><!--header-->
125+
<div class="contents">
126+
<div class="textblock"><div class="fragment"><div class="line">DERESTRICT keyword-or-function[, keyword-or-function...]</div>
127+
</div><!-- fragment --><p>Removes one or more previously applied restrictions from the child restriction set.</p>
128+
<p>After a restriction is removed, future child programs created from the current interpreter context are again permitted to use those keywords or built-in functions.</p>
129+
<h3 class="doxsection"><a class="anchor" id="notes-158"></a>
130+
Notes</h3>
131+
<p><span class="tt">DERESTRICT</span> modifies the set of restrictions that will be passed to child interpreter contexts. It does not affect restrictions already active in existing child programs.</p>
132+
<p>Each item must be the name of a valid BASIC keyword or built-in function.</p>
133+
<p>Multiple items may be removed in a single statement by separating them with commas.</p>
134+
<p>If a restriction is removed, it simply ceases to be inherited by future child contexts.</p>
135+
<h3 class="doxsection"><a class="anchor" id="errors-7"></a>
136+
Errors</h3>
137+
<p>An error is raised if:</p>
138+
<ul>
139+
<li>no keyword or built-in function is provided</li>
140+
<li>a named item is not a valid keyword or built-in function</li>
141+
<li>no restrictions exist to remove from</li>
142+
<li>a named item was not previously restricted</li>
143+
</ul>
144+
<h3 class="doxsection"><a class="anchor" id="examples-150"></a>
145+
Examples</h3>
146+
<div class="fragment"><div class="line">DERESTRICT IF</div>
147+
</div><!-- fragment --><div class="fragment"><div class="line">DERESTRICT OPENIN, GETNAMECOUNT</div>
148+
</div><!-- fragment --><div class="fragment"><div class="line">RESTRICT PRINT, INPUT</div>
149+
<div class="line">DERESTRICT INPUT</div>
150+
<div class="line"> </div>
151+
<div class="line">CHAIN &quot;/programs/untrusted&quot;</div>
152+
</div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="see-also-5"></a>
153+
See also</h3>
154+
<p><a class="el" href="RESTRICT.html">RESTRICT</a>, <a class="el" href="CHAIN.html">CHAIN</a>, <a class="el" href="PROC.html">PROC</a>, <a class="el" href="FN.html">FN</a> </p>
155+
</div></div><!-- contents -->
156+
</div><!-- PageDoc -->
157+
</div><!-- doc-content -->
158+
<div id="page-nav" class="page-nav-panel">
159+
<div id="page-nav-resize-handle"></div>
160+
<div id="page-nav-tree">
161+
<div id="page-nav-contents">
162+
</div><!-- page-nav-contents -->
163+
</div><!-- page-nav-tree -->
164+
</div><!-- page-nav -->
165+
</div><!-- container -->
166+
<!-- HTML footer for doxygen 1.14.0-->
167+
<!-- start footer part -->
168+
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
169+
<ul>
170+
<li class="navelem"><a href="index.html">Retro Rocket OS Documentation</a></li><li class="navelem"><a href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a href="keywords.html">Keywords</a></li>
171+
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
172+
</ul>
173+
</div>
174+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/base16/dracula.min.css">
175+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>
176+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
177+
<script src="rrbasic.js"></script>
178+
<link rel="preconnect" href="https://fonts.googleapis.com">
179+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
180+
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100&display=swap" rel="stylesheet">
181+
<script>
182+
$(function() {
183+
$(".fragment").each(function(i,node) {
184+
var $node = $(node);
185+
$node.children(":not(.line)").remove();
186+
var text = $node.text().trim();
187+
var lang = detect_language(text);
188+
$node.html("<pre><code class='" + lang + "'>" +
189+
text
190+
.replaceAll("&", "&amp;")
191+
.replaceAll("<", "&lt;")
192+
.replaceAll(">", "&gt;") +
193+
"</code></pre>");
194+
hljs.configure({
195+
languages: ['c', 'cpp', 'diff', 'basic', 'rrbasic', 'bash', 'sh', 'text'],
196+
ignoreUnescapedHTML: true
197+
});
198+
hljs.highlightAll(node);
199+
hljs.initLineNumbersOnLoad(node);
200+
$(node).find('.hljs-ln-n').each(function() {
201+
var n = $(this).attr('data-line-number');
202+
if (n) {
203+
this.textContent = n.padStart(2, '0');
204+
}
205+
});
206+
});
207+
$(".fragment").parent().parent().parent().parent().removeClass('doxtable');
208+
});
209+
</script><style>
210+
.hljs-ln-code, code, code a, pre.fragment, div.fragment, div.fragment .line, div.fragment span, div.fragment .line a, div.fragment .line span {
211+
font-family: 'JetBrains Mono', monospace !important;
212+
font-size: 0.8rem !important;
213+
}
214+
.fragment {
215+
padding: 0 !important;
216+
margin-top: 0 !important;
217+
border: none !important;
218+
box-shadow: none !important;
219+
background: none !important;
220+
margin-bottom: 1em !important;
221+
}
222+
#nav-tree,
223+
div.fragment,
224+
pre.fragment {
225+
border: none !important;
226+
box-shadow: none !important;
227+
}
228+
.fragment .hljs {
229+
border: none;
230+
border-radius: 8px;
231+
margin-left: 1em;
232+
margin-right: 1em;
233+
}
234+
.hljs-ln-n::before {
235+
content: attr(data-line-number);
236+
padding-right: 1rem !important;
237+
}
238+
.hljs-ln-n {
239+
color: #2D4068;
240+
}
241+
.hljs-comment {
242+
color: var(--primary-color) !important;
243+
}
244+
</style>
245+
</body>
246+
</html>

docs/DIM.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</div><!-- fragment --><p> Declares an <b>array</b> whose <b>element type</b> is determined by <span class="tt">variable-name</span> (integer, real, or string). <br />
128128
Arrays are <b>zero-indexed</b> and <b>range-checked</b>: the lowest valid index is <span class="tt">0</span> and the highest is <span class="tt">integer-expression - 1</span>.</p>
129129
<hr />
130-
<h5 class="doxsection"><a class="anchor" id="examples-150"></a>
130+
<h5 class="doxsection"><a class="anchor" id="examples-151"></a>
131131
Examples</h5>
132132
<p><b>Integer array</b> </p><div class="fragment"><div class="line">DIM N,5</div>
133133
<div class="line">FOR I = 0 TO 4</div>
@@ -143,7 +143,7 @@ <h5 class="doxsection"><a class="anchor" id="examples-150"></a>
143143
<div class="line">VALUES#(0) = 0.5</div>
144144
<div class="line">VALUES#(1) = 1.5</div>
145145
</div><!-- fragment --><hr />
146-
<h5 class="doxsection"><a class="anchor" id="notes-158"></a>
146+
<h5 class="doxsection"><a class="anchor" id="notes-159"></a>
147147
Notes</h5>
148148
<ul>
149149
<li>The <b>element type</b> follows the variable’s type: e.g. <span class="tt">A</span> → integer array, <span class="tt">A#</span> → real array, <span class="tt">S$</span> → string array.</li>

docs/ELSE.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h3 class="doxsection"><a class="anchor" id="forms"></a>
160160
</div><!-- fragment --></li>
161161
</ul>
162162
<hr />
163-
<h3 class="doxsection"><a class="anchor" id="examples-151"></a>
163+
<h3 class="doxsection"><a class="anchor" id="examples-152"></a>
164164
Examples</h3>
165165
<p><b>Single-line selection</b> </p><div class="fragment"><div class="line">PRINT IF X &gt; 0 THEN &quot;POSITIVE&quot; ELSE &quot;NON-POSITIVE&quot;</div>
166166
</div><!-- fragment --><p><b>Multi-line with ELSE</b> </p><div class="fragment"><div class="line">IF SCORE &gt;= 100 THEN</div>

0 commit comments

Comments
 (0)