Skip to content

Commit 73e0633

Browse files
authored
Merge the x3 branch back into main
Merge pull request #4 from iiPythonx/x3
2 parents e0902e3 + dc4c430 commit 73e0633

File tree

10 files changed

+137
-194
lines changed

10 files changed

+137
-194
lines changed

md/documents/comments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ A comment always starts with two colons `::` and can be placed at the end of any
3030

3131
```xt
3232
:: This is a comment
33-
out 5 :: This is a comment
33+
prt 5 :: This is an inline comment
3434
```
3535

3636
---
3737

38-
Last Updated: February 6th, 2022 by Dm123321_31mD
38+
Last Updated: April 9th, 2023 by iiPython
3939

4040
[↑ Go To Top](#x--documents--comments)

md/documents/comparators.md

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ Or:
7575
"hello" in "hello world"
7676
```
7777

78-
An expression cannot be used on its own, as it is not considered as an operator and thus not a valid statement. It is always accompanied by operators that take an expression as an argument. A classic example of this is the `cmp` operator:
78+
An expression cannot be used on its own, as it is not considered as an operator and thus not a valid statement. It is always accompanied by operators that take an expression as an argument. A classic example of this is the `if` operator:
7979

8080
```xt
81-
cmp 5 == 5 "out \"true\""
81+
if (5 == 5) "prt 'true'"
8282
```
8383

84-
Any operator that uses an expression creates a branch, with `true` being the first branch and `false` is the second. For example, the `cmp` operator creates a branch based on whether or not the expression is true:
84+
Any operator that uses an expression creates a branch, with `true` being the first branch and the second acts as an `else`. For example, the `if` operator creates a branch based on whether or not the expression is true:
8585

8686
```xt
87-
cmp 5 == 10 "out \"same\"" "out \"different\""
87+
if (5 == 10) "prt 'same'" "prt 'different'"
8888
```
8989

9090
## Documentation
@@ -105,7 +105,7 @@ Checks if the two variables or values are equal to each other.
105105
Example:
106106

107107
```xt
108-
cmp 5 == 5 "out \"true\""
108+
if (5 == 5) "prt 'true'"
109109
```
110110

111111
---
@@ -126,7 +126,7 @@ Checks if the two variables or values are different from each other.
126126
Example:
127127

128128
```xt
129-
cmp 5 != 10 "out \"true\""
129+
if (5 != 10) "prt 'true'"
130130
```
131131

132132
---
@@ -147,7 +147,7 @@ Checks if the source is less than the target.
147147
Example:
148148

149149
```xt
150-
cmp 5 < 10 "out \"true\""
150+
if (5 < 10) "prt 'true'"
151151
```
152152

153153
---
@@ -168,7 +168,7 @@ Checks if the source is less than or equal to the target.
168168
Example:
169169

170170
```xt
171-
cmp 5 <= 10 "out \"true\""
171+
if (5 <= 10) "prt 'true'"
172172
```
173173

174174
---
@@ -189,7 +189,7 @@ Checks if the source is greater than the target.
189189
Example:
190190

191191
```xt
192-
cmp 10 > 5 "out \"true\""
192+
if (10 > 5) "prt 'true'"
193193
```
194194

195195
---
@@ -210,7 +210,7 @@ Checks if the source is greater than or equal to the target.
210210
Example:
211211

212212
```xt
213-
cmp 10 >= 5 "out \"true\""
213+
if (10 >= 5) "prt 'true'"
214214
```
215215

216216
---
@@ -231,15 +231,15 @@ Checks if the source is in the target.
231231
Example:
232232

233233
```xt
234-
cmp "ello" in "Hello, world!" "out \"true\""
234+
if ("ello" in "Hello, world!") "prt 'true'"
235235
```
236236

237237
---
238238

239239
### Not In
240240

241241
```xt
242-
<source> xin <target>
242+
<source> not in <target>
243243
```
244244

245245
Checks if the source is not in the target.
@@ -252,7 +252,7 @@ Checks if the source is not in the target.
252252
Example:
253253

254254
```xt
255-
cmp "bye" xin "Hello, world!" "out \"true\""
255+
if ("bye" not in "Hello, world!") "prt 'true'"
256256
```
257257

258258
---
@@ -273,33 +273,11 @@ Checks if the source is a type of the target.
273273
Example:
274274

275275
```xt
276-
cmp 5 is "int" "out \"true\""
276+
if (5 is "int") "prt 'true'"
277277
```
278278

279279
---
280280

281-
### From
282-
283-
```xt
284-
<source> from <target>
285-
```
286-
287-
Checks if the source is an instance of the target.
288-
289-
| Parameter | Type | Description |
290-
| :-: | :-: | :-: |
291-
| Source | Any | The variable or value that is being compared against |
292-
| Target | Any | The variable or value being compared to |
293-
294-
Example:
295-
296-
```xt
297-
evl "setvar('int', int)"
298-
cmp 5 from int "out \"true\""
299-
```
300-
301-
---
302-
303-
Last Updated: February 6th, 2022 by Dm123321_31mD
281+
Last Updated: April 9th, 2023 by iiPython
304282

305283
[↑ Go To Top](#x--documents--comparators)

md/documents/configurations.md

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,19 @@
2929

3030
- [Main](#main)
3131

32-
### Q
33-
34-
- [Quiet](#quiet)
35-
3632
## About
3733

3834
The configuration file defines what the project would do on execution. It is always placed in the `.xtconfig` file and should be written as if it is within a `*.json` file. If one is not found in the project, the default configuration is used internally instead:
3935

40-
```xtconfig
36+
```xconfig
4137
{
42-
"main": "main.xt",
43-
"quiet": false
38+
"main": "main.xpp"
4439
}
4540
```
4641

47-
If an essential field is missing, it is replaced with a default value internally instead:
48-
49-
```xtconfig
50-
{
51-
"main": "main.xt"
52-
}
53-
```
54-
55-
> Because the `quiet` field is missing, its default value, `false`, is used instead.
56-
5742
The configuration file can also contain non-essential information, such as the author, version, or description of your project:
5843

59-
```xtconfig
44+
```xconfig
6045
{
6146
"author": "my-name",
6247
"contributors": [
@@ -69,11 +54,13 @@ The configuration file can also contain non-essential information, such as the a
6954
}
7055
```
7156

57+
> This is part of the official .xconfig specification. In fact, `xpp --show <module>` will use this spec.
58+
7259
## Documentation
7360

7461
### Main
7562

76-
```xtconfig
63+
```xconfig
7764
{
7865
"main": <path>
7966
}
@@ -83,26 +70,10 @@ Defines the path of the main entry file.
8370

8471
| Parameter | Type | Default | Description |
8572
| :-: | :-: | :-: | :-: |
86-
| Path | String\<JSON> | "main.xt" | Main entry file path relative to the current working directory |
87-
88-
---
89-
90-
### Quiet
91-
92-
```xtconfig
93-
{
94-
"quiet": <option>
95-
}
96-
```
97-
98-
Throws errors silently.
99-
100-
| Parameter | Type | Default | Description |
101-
| :-: | :-: | :-: | :-: |
102-
| Option | Boolean\<JSON> | false | Whether or not to throw error silently |
73+
| Path | String\<JSON> | "main.xpp" | Entrypoint relative to the current package (or cwd if it's a file) |
10374

10475
---
10576

106-
Last Updated: February 6th, 2022 by Dm123321_31mD
77+
Last Updated: April 9th, 2023 by iiPython
10778

10879
[↑ Go To Top](#x--documents--configurations)

0 commit comments

Comments
 (0)