Skip to content

Commit 6f348d1

Browse files
authored
Merge pull request #84 from Robotnik08/development
Development
2 parents d3d8a2d + 6b61550 commit 6f348d1

Some content is hidden

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

72 files changed

+4003
-1291
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="assets/dosato_logo_wide.png">
33
</p>
44

5-
# Dosato version 0.6.6
5+
# Dosato version 0.6.7
66

77
cDosato is the official implementation of the DOSATO programming language.<br>
88

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ All versions in the release section are supported
66

77
| Version | Supported |
88
| ------- | ------------------ |
9-
| 0.6.6 | :white_check_mark: |
10-
| < 0.6.6 | :x: |
9+
| 0.6.7 | :white_check_mark: |
10+
| < 0.6.7 | :x: |
1111

1212
## Reporting a Vulnerability
1313

demo/oop.to

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Person (name, age) {
88
}
99

1010
class Student (name, age, grade) {
11-
set self += Person(name, age)
11+
inherit Person(name, age)
1212
set self->grade = grade
1313

1414
implement sayGrade () {

dosato_api/dosato.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ typedef enum {
113113
E_INVALID_AMOUNT_SET_EXPRESSION,
114114
E_INVALID_IDENTIFIER,
115115
E_NOT_ITERABLE,
116+
E_MASTER_MUST_BE_IN_CLASS,
116117

117118
// standard library errors
118119
E_FILE_NOT_FOUND,
@@ -306,30 +307,30 @@ extern void free_ValueArray(ValueArray* array);
306307
extern void destroyValueArray(ValueArray* array);
307308

308309
extern void init_ValueObject(ValueObject* object);
309-
extern void write_ValueObject(ValueObject* object, char* key, Value value);
310+
extern void write_ValueObject(ValueObject* object, Value key, Value value);
310311
extern void free_ValueObject(ValueObject* object);
311312

312313
/**
313314
* @brief Checks if an object has a key.
314315
* @param object The object to check.
315316
* @param key The key to check for.
316317
*/
317-
extern bool hasKey(ValueObject* object, char* key);
318+
extern bool hasKey(ValueObject* object, Value key);
318319

319320
/**
320321
* @brief Gets the value at a specific key in an object.
321322
* @param object The object to get the value from.
322323
* @param key The key to get the value from.
323324
* @return The value at the key, or NULL if the key does not exist.
324325
*/
325-
extern Value* getValueAtKey(ValueObject* object, char* key);
326+
extern Value* getValueAtKey(ValueObject* object, Value key);
326327

327328
/**
328329
* @brief Removes a key from an object, this does safely destroy the value and the key of the object.
329330
* @param object The object to remove the key from.
330331
* @param key The key to remove.
331332
*/
332-
extern void removeFromKey(ValueObject* object, char* key);
333+
extern void removeFromKey(ValueObject* object, Value key);
333334

334335
/// virtual-machine.h
335336
/// This part of the library is responsible for handling virtual machine gc generation and running.

include/code_instance.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ typedef enum {
6464
OP_BINARY_RANGE_UP_INCLUSIVE,
6565
OP_BINARY_RANGE_DOWN_INCLUSIVE,
6666
OP_BINARY_NULL_COALESCE,
67+
OP_BINARY_STRICT_EQUAL,
68+
OP_BINARY_STRICT_NOT_EQUAL,
6769

6870
OP_UNARY_NEGATE,
6971
OP_UNARY_LOGICAL_NOT,
@@ -117,6 +119,11 @@ typedef enum {
117119
// Super Instructions
118120
OP_STORE_FAST_POP,
119121
OP_STORE_FAST_CONSTANT,
122+
OP_STORE_FAST_POP_CONSTANT,
123+
OP_STORE_FAST_FORCED,
124+
125+
OP_DEFINE_CONSTANT,
126+
OP_DEFINE_POP_CONSTANT,
120127

121128
OP_TEMP // temporary opcode for swapping
122129

include/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <unistd.h>
2222
#endif
2323

24-
#define DOSATO_VERSION "0.6.6"
24+
#define DOSATO_VERSION "0.6.7"
2525
#ifndef DOSATO_DATE
2626
#define DOSATO_DATE "Unknown date"
2727
#endif

include/error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ typedef enum {
6767
E_INVALID_AMOUNT_SET_EXPRESSION,
6868
E_INVALID_IDENTIFIER,
6969
E_NOT_ITERABLE,
70+
E_MASTER_MUST_BE_IN_CLASS,
7071

7172
// standard library errors
7273
E_FILE_NOT_FOUND,

include/node.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ typedef enum {
2222
NODE_MASTER_IMPLEMENT,
2323
NODE_MASTER_ENUM,
2424
NODE_MASTER_IF,
25+
NODE_MASTER_INHERIT,
2526

2627
NODE_MASTER_DO_BODY,
2728
NODE_MASTER_MAKE_BODY,
@@ -38,6 +39,7 @@ typedef enum {
3839
NODE_MASTER_IMPLEMENT_BODY,
3940
NODE_MASTER_ENUM_BODY,
4041
NODE_MASTER_IF_BODY,
42+
NODE_MASTER_INHERIT_BODY,
4143

4244

4345
NODE_WHEN_BODY,

include/standard_libraries/std_array.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,11 @@ Value array_every(ValueArray args, bool debug);
3232
Value array_count(ValueArray args, bool debug);
3333
Value array_sum(ValueArray args, bool debug);
3434
Value array_find(ValueArray args, bool debug);
35+
Value array_combinations(ValueArray args, bool debug);
36+
void combinationUtil(Value* arr, int n, int r, int index, int* data, int i, ValueArray* new_array);
37+
Value array_permutations(ValueArray args, bool debug);
38+
void permutationUtil(Value* arr, int n, int r, int index, int* data, bool* used, ValueArray* new_array);
39+
Value array_remove_duplicates(ValueArray args, bool debug);
40+
Value array_length(ValueArray args, bool debug);
3541

3642
#endif // STD_ARRAY_H

include/standard_libraries/std_math.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ Value math_acos(ValueArray args, bool debug);
2424
Value math_atan(ValueArray args, bool debug);
2525
Value math_atan2(ValueArray args, bool debug);
2626
Value math_exp(ValueArray args, bool debug);
27+
Value math_digits(ValueArray args, bool debug);
28+
Value math_gdc(ValueArray args, bool debug);
29+
Value math_lcm(ValueArray args, bool debug);
2730

2831
#endif // STD_MATH_H

0 commit comments

Comments
 (0)