Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 7debc0f

Browse files
committed
Updated to fit #23
1 parent 756b9e9 commit 7debc0f

File tree

6 files changed

+22
-24
lines changed

6 files changed

+22
-24
lines changed

ilanguage/Grammar/base.ebnf

Whitespace-only changes.

ilanguage/Main/lexer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
DIGITS_AS_STRINGS: Final[List[str]] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
5959

60-
# TODO (ElBe): Add grammar instead of this
60+
# TODO (ElBe): Add grammar instead of this (scheduled for version 0.0.10)
6161
SEPARATORS: Final[List[str]] = [" ", "\t", "\n"]
6262
DOUBLE_MARKS: Final[Dict[str, str]] = {
6363
"==": "EQUAL",
@@ -177,7 +177,7 @@ def validate_float(string: str) -> bool:
177177
string (str): Text to validate.
178178
179179
Returns:
180-
True if the string is a valid float, False otherwise.
180+
bool: True if the string is a valid float, False otherwise.
181181
"""
182182

183183
string = string.replace(" ", "")
@@ -202,7 +202,7 @@ def validate_integer(string: str) -> bool:
202202
string (str): Text to validate.
203203
204204
Returns:
205-
True if the string is a valid integer, False otherwise.
205+
bool: True if the string is a valid integer, False otherwise.
206206
"""
207207

208208
string = string.replace(" ", "")
@@ -444,8 +444,7 @@ def lex( # pylint: disable=R0912, R0915, R1260
444444
DATA = file.read()
445445
except (IndexError, FileNotFoundError):
446446
DATA = """
447-
int i = 1234
448-
float f = 12.34
447+
// Code goes here
449448
"""
450449

451450
if options["types"] and not options["values"]:

ilanguage/Modules/Console.ilang

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
// IMPORTS //
2929
/////////////
3030

31-
import _core
32-
import types // TODO (ElBe): Add
31+
import _core;
32+
import types; // TODO (ElBe): Add this
3333

3434

3535
///////////
@@ -46,5 +46,5 @@ import types // TODO (ElBe): Add
4646
* str: The table.
4747
*/
4848
str table(types.iterable data) {
49-
return _core.Console.Table.__init__(data)
49+
return _core.Console.Table.__init__(data);
5050
}

ilanguage/Modules/Math.ilang

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
// IMPORTS //
2929
/////////////
3030

31-
import _core
32-
import types
31+
import _core;
32+
import types;
3333

3434

3535
///////////////
3636
// CONSTANTS //
3737
///////////////
3838

39-
const float Pi = 3.141592653589793238462643383279502884197
40-
const float E = 2.718281828459045235360287471352662497757
41-
const float Infinite = _core.Math.Infinite
39+
const float Pi = 3.141592653589793238462643383279502884197;
40+
const float E = 2.718281828459045235360287471352662497757;
41+
const float Infinite = _core.Math.Infinite;
4242

4343

4444
///////////
@@ -55,7 +55,7 @@ const float Infinite = _core.Math.Infinite
5555
* int: Rounded number.
5656
*/
5757
int round(float number) {
58-
return _core.Math.round(number)
58+
return _core.Math.round(number);
5959
}
6060

6161

@@ -73,7 +73,7 @@ int round(float number) {
7373
* int: Rounded number.
7474
*/
7575
int floor(float number) {
76-
return _core.Math.floor(number)
76+
return _core.Math.floor(number);
7777
}
7878

7979

@@ -91,7 +91,7 @@ int floor(float number) {
9191
* int: Rounded number.
9292
*/
9393
int ceil(float number) {
94-
return _core.Math.ceil(number)
94+
return _core.Math.ceil(number);
9595
}
9696

9797

@@ -110,7 +110,7 @@ class Complex(type) {
110110
* complex: Complex number.
111111
*/
112112
int init(value: int) {
113-
parent.init(value, types.Complex)
114-
return value
113+
parent.init(value, types.Complex);
114+
return value;
115115
}
116116
}

ilanguage/Modules/Random.ilang

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// IMPORTS //
2929
/////////////
3030

31-
import _core
31+
import _core;
3232

3333

3434
////////////////////
@@ -50,8 +50,7 @@ import _core
5050
* Int: Random integer.
5151
*/
5252
int randint(int minimum, int maximum) {
53-
54-
return _core.Random.randint(minimum, maximum)
53+
return _core.Random.randint(minimum, maximum);
5554
}
5655

5756

@@ -75,7 +74,7 @@ int randint(int minimum, int maximum) {
7574
* Any: Chosen object(s) from the iterable.
7675
*/
7776
function choices(list iterable, int choices = 1) {
78-
return _core.Random.choices(iterable, choices)
77+
return _core.Random.choices(iterable, choices);
7978
}
8079

8180

@@ -97,5 +96,5 @@ function choices(list iterable, int choices = 1) {
9796
* list: Shuffled list.
9897
*/
9998
list shuffle(list iterable) {
100-
return _code.Random.shuffle(iterable)
99+
return _code.Random.shuffle(iterable);
101100
}

ilanguage/example.ilang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Everything should be self explanatory
2222
*
2323
* SEMICOLONS:
24-
* Semicolons are required since version 0.0.8.
24+
* Semicolons are required since version 0.0.9.
2525
*/
2626

2727

0 commit comments

Comments
 (0)