Skip to content

Commit 019530e

Browse files
authored
Merge pull request #167 from Flipez/release-0-21
update docs
2 parents f429783 + d1bb32a commit 019530e

36 files changed

Lines changed: 2181 additions & 1 deletion

docs/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const config = {
3232
sidebarPath: require.resolve('./sidebars.js'),
3333
editUrl:
3434
'https://github.com/flipez/rocket-lang/tree/main/docs/',
35-
lastVersion: 'v0.20.1',
35+
lastVersion: 'v0.21.0',
3636
},
3737
theme: {
3838
customCss: require.resolve('./src/css/custom.css'),
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import CodeBlockSimple from '@site/components/CodeBlockSimple'
2+
3+
# HTTP
4+
5+
6+
7+
8+
## Module Function
9+
10+
### new()
11+
> Returns `HTTP`
12+
13+
Creates a new instance of HTTP
14+
15+
16+
17+
18+
19+
20+
## Properties
21+
| Name | Value |
22+
| ---- | ----- |
23+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import CodeBlockSimple from '@site/components/CodeBlockSimple'
2+
3+
# IO
4+
5+
6+
7+
8+
## Module Function
9+
10+
### open(STRING, STRING, STRING)
11+
> Returns `FILE`
12+
13+
Opens a file pointer to the file at the path, mode and permission can be set optionally.
14+
15+
16+
<CodeBlockSimple input='IO.open("main.go", "r", "0644")
17+
' output='<file:main.go>
18+
' />
19+
20+
21+
22+
## Properties
23+
| Name | Value |
24+
| ---- | ----- |
25+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import CodeBlockSimple from '@site/components/CodeBlockSimple'
2+
3+
# JSON
4+
5+
6+
7+
8+
## Module Function
9+
10+
### parse(STRING)
11+
> Returns `HASH`
12+
13+
Takes a STRING and parses it to a HASH or ARRAY. Numbers are always FLOAT.
14+
15+
16+
<CodeBlockSimple input='JSON.parse(&apos;{"test": 123}&apos;)
17+
JSON.parse(&apos;["test", 123]&apos;)
18+
' output='{"test": 123.0}
19+
["test", 123.0]
20+
' />
21+
22+
23+
24+
## Properties
25+
| Name | Value |
26+
| ---- | ----- |
27+
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
import CodeBlockSimple from '@site/components/CodeBlockSimple'
2+
3+
# Math
4+
5+
6+
7+
8+
## Module Function
9+
10+
### abs(FLOAT)
11+
> Returns `FLOAT`
12+
13+
14+
15+
16+
17+
18+
19+
### acos(FLOAT)
20+
> Returns `FLOAT`
21+
22+
Returns the arccosine, in radians, of the argument
23+
24+
25+
<CodeBlockSimple input='Math.acos(1.0)
26+
' output='0.0
27+
' />
28+
29+
30+
### asin(FLOAT)
31+
> Returns `FLOAT`
32+
33+
Returns the arcsine, in radians, of the argument
34+
35+
36+
<CodeBlockSimple input='Math.asin(0.0)
37+
' output='0.0
38+
' />
39+
40+
41+
### atan(FLOAT)
42+
> Returns `FLOAT`
43+
44+
Returns the arctangent, in radians, of the argument
45+
46+
47+
<CodeBlockSimple input='Math.atan(0.0)
48+
' output='0.0
49+
' />
50+
51+
52+
### ceil(FLOAT)
53+
> Returns `FLOAT`
54+
55+
Returns the least integer value greater or equal to the argument
56+
57+
58+
<CodeBlockSimple input='Math.ceil(1.49)
59+
' output='2.0
60+
' />
61+
62+
63+
### copysign(FLOAT, FLOAT)
64+
> Returns `FLOAT`
65+
66+
Returns a value with the magnitude of first argument and sign of second argument
67+
68+
69+
<CodeBlockSimple input='Math.copysign(3.2, -1.0)
70+
' output='-3.2
71+
' />
72+
73+
74+
### cos(FLOAT)
75+
> Returns `FLOAT`
76+
77+
Returns the cosine of the radion argument
78+
79+
80+
<CodeBlockSimple input='Math.cos(Pi/2)
81+
' output='0.0
82+
' />
83+
84+
85+
### exp(FLOAT)
86+
> Returns `FLOAT`
87+
88+
Returns e**argument, the base-e exponential of argument
89+
90+
91+
<CodeBlockSimple input='Math.exp(1.0)
92+
' output='2.72
93+
' />
94+
95+
96+
### floor(FLOAT)
97+
> Returns `FLOAT`
98+
99+
Returns the greatest integer value less than or equal to argument
100+
101+
102+
<CodeBlockSimple input='Math.floor(1.51)
103+
' output='1.0
104+
' />
105+
106+
107+
### log(FLOAT)
108+
> Returns `FLOAT`
109+
110+
Returns the natural logarithm of argument
111+
112+
113+
<CodeBlockSimple input='Math.log(2.7183)
114+
' output='1.0
115+
' />
116+
117+
118+
### log10(FLOAT)
119+
> Returns `FLOAT`
120+
121+
Returns the decimal logarithm of argument
122+
123+
124+
<CodeBlockSimple input='Math.log(100.0)
125+
' output='2.0
126+
' />
127+
128+
129+
### log2(FLOAT)
130+
> Returns `FLOAT`
131+
132+
Returns the binary logarithm of argument
133+
134+
135+
<CodeBlockSimple input='Math.log2(256.0)
136+
' output='8.0
137+
' />
138+
139+
140+
### max(FLOAT, FLOAT)
141+
> Returns `FLOAT`
142+
143+
Returns the larger of the two numbers
144+
145+
146+
<CodeBlockSimple input='Math.max(5.0, 10.0)
147+
' output='10.0
148+
' />
149+
150+
151+
### min(FLOAT, FLOAT)
152+
> Returns `FLOAT`
153+
154+
Returns the smaller of the two numbers
155+
156+
157+
<CodeBlockSimple input='Math.min(5.0, 10.0)
158+
' output='5.0
159+
' />
160+
161+
162+
### pow(FLOAT, FLOAT)
163+
> Returns `FLOAT`
164+
165+
Returns argument1**argument2, the base-argument1 exponential of argument2
166+
167+
168+
<CodeBlockSimple input='Math.pow(2.0, 3.0)
169+
' output='8.0
170+
' />
171+
172+
173+
### rand()
174+
> Returns `FLOAT`
175+
176+
Returns a pseudo-random number in the half-open interval [0.0, 1.0].
177+
178+
179+
<CodeBlockSimple input='Math.rand()
180+
' output='0.6046602879796196
181+
' />
182+
183+
184+
### remainder(FLOAT, FLOAT)
185+
> Returns `FLOAT`
186+
187+
Returns the IEEE 754 floating-point remainder of argument1/argument2
188+
189+
190+
<CodeBlockSimple input='Math.remainder(100.0, 30.0)
191+
' output='10.0
192+
' />
193+
194+
195+
### round(FLOAT)
196+
> Returns `FLOAT`
197+
198+
Returns the nearest integer, rounding half away from zero
199+
200+
201+
<CodeBlockSimple input='Math.round(73.3)
202+
' output='73.0
203+
' />
204+
205+
206+
### sin(FLOAT)
207+
> Returns `FLOAT`
208+
209+
Returns the sine of the radion argument
210+
211+
212+
<CodeBlockSimple input='Math.sin(Pi)
213+
' output='0.0
214+
' />
215+
216+
217+
### sqrt(FLOAT)
218+
> Returns `FLOAT`
219+
220+
Returns the square root of argument
221+
222+
223+
<CodeBlockSimple input='Math.sqrt(3.0 * 3.0 + 4.0 * 4.0)
224+
' output='5.0
225+
' />
226+
227+
228+
### tan(FLOAT)
229+
> Returns `FLOAT`
230+
231+
Returns the tangent of the radion argument
232+
233+
234+
<CodeBlockSimple input='Math.tan(0.0)
235+
' output='0.0
236+
' />
237+
238+
239+
240+
## Properties
241+
| Name | Value |
242+
| ---- | ----- |
243+
| E | 2.718281828459045 |
244+
| Ln10 | 2.302585092994046 |
245+
| Ln2 | 0.6931471805599453 |
246+
| Log10E | 0.4342944819032518 |
247+
| Log2E | 1.4426950408889634 |
248+
| Phi | 1.618033988749895 |
249+
| Pi | 3.141592653589793 |
250+
| Sqrt2 | 1.4142135623730951 |
251+
| SqrtE | 1.6487212707001282 |
252+
| SqrtPhi | 1.272019649514069 |
253+
| SqrtPi | 1.772453850905516 |
254+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import CodeBlockSimple from '@site/components/CodeBlockSimple'
2+
3+
# OS
4+
5+
6+
7+
8+
## Module Function
9+
10+
### exit(INTEGER)
11+
> Returns ``
12+
13+
Terminates the program with the given exit code.
14+
15+
16+
<CodeBlockSimple input='OS.exit(1)
17+
' output='exit status 1
18+
' />
19+
20+
21+
### raise(INTEGER, STRING)
22+
> Returns ``
23+
24+
Terminates the program with the given exit code and prints the error message.
25+
26+
27+
<CodeBlockSimple input='OS.raise(1, "broken")
28+
' output='🔥 RocketLang raised an error: "broken"
29+
exit status 1
30+
' />
31+
32+
33+
34+
## Properties
35+
| Name | Value |
36+
| ---- | ----- |
37+

0 commit comments

Comments
 (0)