Skip to content

Commit 7efead6

Browse files
Release 0.0.2
Added Commandline file support
1 parent 5180bb1 commit 7efead6

File tree

3 files changed

+57
-20
lines changed

3 files changed

+57
-20
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [0.0.2] - 28-05-2023
10+
User Defined Functions
11+
12+
### Added
13+
- User Defined Functions
14+
- Closures
15+
- Command line Execution of Interpreter
16+
17+
### Removed
18+
- `return` keyword
19+
20+
921
## [0.0.1] - 25-05-2023
1022
First Release (Coda Release-alpha)
1123

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Coda
22
## C++ Objects Dynamic Architecture
3-
Coda is an interpreted utility language designed to provide a flexible and efficient programming experience.
4-
The name "Coda" represents its ability to complement existing coding languages by serving as a valuable addition
5-
or extension to any software development project.
3+
Coda is a C++-based interpreted language designed to allow for rapid development and execution of code.
4+
Its built-in functions and libraries simplify common programming tasks, improving productivity.
5+
Coda also offers high performance and versatility thanks to its implementation in C++.
6+
67

78
## Features
89

@@ -20,33 +21,45 @@ To start using Coda, follow these steps:
2021

2122
1. Install the Coda interpreter.
2223
2. Write your Coda code in a text file with the `.coda` extension.
23-
3. Run the Coda code by executing the interpreter with the path to your code file.
24-
Simply Run the Code, and start using it as a editor.
24+
3. Run the Coda interpreter with the path to your Coda file as an argument.
25+
For example, if your Coda file is named `hello.coda`, you would run the interpreter as follows:
26+
```
27+
Coda hello.coda
28+
29+
OR
30+
31+
Coda.exe hello.coda
32+
```
2533

2634
# Development Roadmap
2735
- [x] Lexer/Tokenizer
2836
- [x] Parser
2937
- [x] Interpreter
30-
- [ ] Number Datatypes (int,float,byte,double) (removed)
31-
- [x] Boolean Types (bool, uses c++ boolean in background)
38+
- [x] Boolean Types (bool, uses C++ Boolean in background)
3239
- [x] Strings
3340
- [x] Variables (Assignment - dynamic)
3441
- [x] Variables (Assignment - constants)
3542
- [x] Variables (Look Up)
3643
- [x] Objects (Js-like objects)
3744
- [x] Native Functions (printing,inputs,sleep)
38-
- [ ] User Defined functions
45+
- [x] BuiltIn Functions (parse<data-type>,conversions)
46+
- [x] User Defined functions
3947
- [ ] Arrays
40-
- [ ] BuiltIn Functions (parse<data-type>,conversions)
4148
- [ ] Control Statements (if statements)
4249
- [ ] Control Statements (for loops)
4350
- [ ] Control Statements (while loops)
4451
- [ ] Control Statements (forEach loops)
45-
- [ ] Packages (importing and creating, potentially in C++ dll's))
52+
- [ ] Packages (importing and creating, potentially in C++ dll))
4653
- [ ] Object-Orientation
4754

4855
## Contributing
49-
Contributions to the Coda language are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the official Coda GitHub repository.
56+
Contributions to the Coda language are welcome!
57+
If you encounter any issues or have suggestions for improvements,
58+
please open an issue or submit a pull request on the official Coda GitHub repository.
59+
60+
## Changelog
61+
See the [CHANGELOG](CHANGELOG.md) file for details.
62+
Go through the Changelog to see the progress of the language.
5063

5164
## License
5265
Coda is open-source software released under the MIT License.

main.cpp

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,30 @@ int repl() {
3333
return 0;
3434
}
3535

36-
int main() {
3736

38-
#ifdef _DEBUG
37+
38+
int main(int argc, char** argv) {
3939
Coda::Runtime::Environment env = Coda::Runtime::Environment::root();
40+
std::string filename;
4041

41-
Coda::Utils::FileReader fr = { "Test/func.coda" };
42+
#ifdef _DEBUG
43+
filename = "Test/func.coda";
44+
#else
45+
if (argc > 1) {
46+
filename = argv[1];
47+
}
48+
else {
49+
std::cout << "No file specified" << std::endl;
50+
return 1;
51+
}
52+
#endif
53+
54+
Coda::Utils::FileReader fr = { filename };
4255
std::string source = fr.readToString();
4356

44-
if (source.empty())
57+
if (source.empty()) {
4558
return 0;
59+
}
4660

4761
Coda::Frontend::Lexer lexer = Coda::Frontend::Lexer();
4862
std::vector<Coda::Frontend::Token> tokens = lexer.tokenise(source);
@@ -53,10 +67,8 @@ int main() {
5367

5468
IF_ERROR_RETURN(1);
5569
Coda::Runtime::Interpreter inter = Coda::Runtime::Interpreter();
56-
Coda::Runtime::Value out = inter.evaluateProgram(program, env);
70+
inter.evaluateProgram(program, env);
5771

58-
#else
59-
return repl();
72+
return 0;
73+
}
6074

61-
#endif
62-
}

0 commit comments

Comments
 (0)