Skip to content

Commit

Permalink
Merge pull request #48 from Robotnik08/development
Browse files Browse the repository at this point in the history
0.4.7
  • Loading branch information
Robotnik08 authored Oct 20, 2024
2 parents 97d2fa6 + 9d92950 commit 30af551
Show file tree
Hide file tree
Showing 12 changed files with 212 additions and 258 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="assets/dosato_logo_wide.png">
</p>

# CDosato version 0.4.6
# CDosato version 0.4.7

CDosato is the official implementation of the DOSATO programming language.<br>

Expand All @@ -22,6 +22,8 @@ CDosato is the official implementation of the DOSATO programming language.<br>

Dosato is a general purpose interpreted programming language that is designed to be simple and easy to use. It is a dynamically typed language that supports static typing as well.<br>
The language is pretty simple and easy to learn. It is designed to be beginner friendly and is a great language to start with if you are new to programming.<br>
Dosato allows for syntax that is easy and straightforward to understand and at the same time allows for complex and compact code.<br>
Theres no wrong way to write dosato code, it allows nearly any style of programming.<br>


## Installation
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ All versions in the release section are supported

| Version | Supported |
| ------- | ------------------ |
| 0.4.6 | :white_check_mark: |
| < 0.4.6 | :x: |
| 0.4.7 | :white_check_mark: |
| < 0.4.7 | :x: |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <unistd.h>
#endif

#define DOSATO_VERSION "0.4.6"
#define DOSATO_VERSION "0.4.7"
#ifndef DOSATO_DATE
#define DOSATO_DATE "Unknown date"
#endif
Expand Down
84 changes: 10 additions & 74 deletions include/strtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,17 @@
#include "common.h"

#define IS_SPACE(c) (c == ' ' || c == '\n' || c == '\t' || c == '\0')
#define IS_NUMERIC(c) (c >= '0' && c <= '9')
#define IS_ALPHA(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
#define IS_ALPHANUMERIC(c) (IS_NUMERIC(c) || IS_ALPHA(c) || c == '_')
#define IS_ALPHANAMERIC(c) (IS_ALPHA(c) || c == '_')
#define IS_HEXADECIMAL(c) (IS_NUMERIC(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
#define IS_OCTAL(c) (c >= '0' && c <= '7')
#define IS_BINARY(c) (c == '0' || c == '1')
#define IS_FLOATERIC(c) (IS_NUMERIC(c) || c == '.' || c == 'F')



/**
* @brief Check if a character is numeric
* @param c The character to check
*/
int isNumeric (char c);
/**
* @brief Check if a character is alphabetic
* @param c The character to check
*/
int isAlpha (char c);
/**
* @brief Check if a character is a space, new line, or tab, or even a \0
* @param c The character to check
*/
int isTrueEmpty (char c);
/**
* @brief Check if a character is empty
* @param c The character to check
*/
int isEmpty (char c);
/**
* @brief Check if a character is alphanumeric
* @param c The character to check
*/
int isAlphaNumeric (char c);
/**
* @brief Check if a character is Alpha or has an underscore
* @param c The character to check
*/
int isAlphaNameric (char c);
/**
* @brief Check if a character is a number or a period
* @param c The character to check
*/
int isFloateric (char c);
/**
* @brief Split a string into an array of strings, make sure to free the result
* @param input The string to split
* @param separator The separator to split by
*/
char** strspl(const char* input, const char* separator);
/**
* @brief Replace all instances of a string with another string
* @param in The string to replace in
* @param selector The string to replace
* @param replacement The string to replace with
* @return The amount of times the string was replaced
*/
int strrep(char *in, const char *selector, const char *replacement);
/**
* @brief Get the Next Word in a String
* @param text The text to get the word from
Expand All @@ -74,31 +35,6 @@ int getLine (const char* text, int pos);
*/
int getLineCol (const char* text, int pos);

/**
* @brief Remove the first and last character of a string
* @param test The string to remove the first and last character of
* @param amount The amount of characters to remove
* @return The new string (don't forget to free it)
*/
char* removeLastAndFirstChar(const char* str, int amount);

/**
* @brief Check if a string starts and ends with a character
* @param str The string to check
* @param character The character to check
* @warning The buffer is 1024 x the size of the string, so don't use this for large strings or large replacements
*/
int strsur (const char* str, const char character);

/**
* @brief Count the amount of times a character appears in a string
* @param str The string to check
* @param character The character to check
* @return The amount of times the character appears in the string
*/
int strchl (const char* str, const char character);


/**
* @brief Convert a string to uppercase
* @param str The string to convert
Expand Down
3 changes: 3 additions & 0 deletions include/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ typedef enum {
TOKEN_COMMENT = 0,
TOKEN_STRING,
TOKEN_NUMBER,
TOKEN_NUMBER_HEX,
TOKEN_NUMBER_BINARY,
TOKEN_NUMBER_OCTAL,
TOKEN_OPERATOR,
TOKEN_MASTER_KEYWORD,
TOKEN_EXT,
Expand Down
Loading

0 comments on commit 30af551

Please sign in to comment.