Skip to content

Commit 9b02601

Browse files
Polish the repo
1 parent 5593107 commit 9b02601

File tree

5 files changed

+39
-23
lines changed

5 files changed

+39
-23
lines changed

CritLang/CritLang.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<PackageOutputPath>./nupkg</PackageOutputPath>
1818
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1919
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
20+
<AssemblyName>crit</AssemblyName>
2021
</PropertyGroup>
2122

2223
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -43,7 +44,7 @@
4344
<PackageReference Include="Antlr4BuildTasks" Version="12.1.0" PrivateAssets="all" />
4445
</ItemGroup>
4546
<ItemGroup>
46-
<None Update=".\sieve.crit">
47+
<None Include="..\Examples\sieve.crit">
4748
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4849
</None>
4950
</ItemGroup>

CritLang/CritLangCross.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<PackageOutputPath>./nupkg</PackageOutputPath>
1818
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1919
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
20+
<TargetName>crit</TargetName>
2021
</PropertyGroup>
2122

2223
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -43,7 +44,7 @@
4344
<PackageReference Include="Antlr4BuildTasks" Version="12.1.0" PrivateAssets="all" />
4445
</ItemGroup>
4546
<ItemGroup>
46-
<None Update=".\sieve.crit">
47+
<None Include="..\Examples\sieve.crit">
4748
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4849
</None>
4950
</ItemGroup>

Examples/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Examples
2+
3+
So [here](sieve.crit) is and implemantation of the [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes).
4+
You can see that I start off by filling the array with an `until` loop and then I just use come of the standart functions to do the rest.
5+
If you run the sieve you would get something like this:
6+
7+
```pwsh
8+
crit sieve.crit
9+
10+
# output
11+
12+
Found 2762 and 22238 composites in 25000 numbers! Time: 0.5 seconds
13+
```
File renamed without changes.

README.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Crit (the programming language)
22

33
## What is Crit?
4-
Crit is an interpreted dynamic programming language made with C# and [ANTLR4](https://www.antlr.org/).<br>
5-
This language is still very experimental and is no were to be used for production.<br>
6-
Why the name? Because in League of Legends, **no crit = no bitches**.<br>
74

8-
The language is [turing complete](https://en.wikipedia.org/wiki/Turing_completeness) (I think) so theoretically you can solve any computational problem with Crit!<br>
5+
Crit is an interpreted dynamic programming language made with C# and [ANTLR4](https://www.antlr.org/).
6+
This language is still very experimental and is no were to be used for production.
7+
Why the name? Because in League of Legends, **no crit = no bitches**.
8+
9+
The language is [turing complete](https://en.wikipedia.org/wiki/Turing_completeness) (I think) so theoretically you can solve any computational problem with Crit!
910

1011
The syntax is somewhat similar to Golang's syntax.
1112
Check the Change log [here](CHANGELOG.MD).
1213

1314
## Code Preview
15+
1416
```rust
1517
num = 5;
1618
#Comment
@@ -29,68 +31,67 @@ else {
2931
WriteLine("num was already bigger than 10.");
3032
}
3133
```
32-
You can look [here](CritLang/sieve.crit) for more an implemantion of the [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) in crit!
34+
35+
You can look [here](https://github.com/lucascompython/CritLang/tree/master/Examples) for more an implemantion of the [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) in crit!
3336

3437
## Documentation
38+
3539
Check [here](https://github.com/lucascompython/CritLang/wiki/Language-Defenition) for the language definition.
40+
3641
## Tips and Tricks
37-
You can have a else block after a while loop declaration to avoid a if statement.<br>
38-
To have syntax highlighting you can set the language to Golang or Rust, I've tested both and they look fine to me.<br>
42+
43+
You can have a else block after a while loop declaration to avoid a if statement.
44+
To have syntax highlighting you can set the language to Golang or Rust, I've tested both and they look fine to me.
3945
This language also has a `until` keyword, which is just like the `while` keyword but with the opposite condition.
46+
4047
```rust
4148
until num > 10 {
4249
WriteLine(num);
4350
num = num + 1;
4451
}
4552
```
4653

47-
48-
49-
50-
5154
## Run It
55+
5256
```powershell
5357
git clone https://github.com/lucascompython/CritLang.git
5458
cd CritLang/CritLang
5559
./build.ps1 -help
5660
```
5761

58-
5962
## TODOs
6063

6164
- [X] Documentation.
6265
- [X] Automatically detect the length of a number and assign to it the corret type (int, long, float and double)
6366
- [X] Add Python like dictionaries.
6467
- [ ] Integrate [NANQL](https://github.com/lucascompython/NANQL) with Crit's dictionaries and arrays.
65-
- [ ] Seperate code into different files.
66-
- [ ] Add Crit's own types & remove most object types.
6768
- [ ] Add the hability of making functions.
69+
- [ ] Seperate code into different files.
70+
- [ ] Add Crit's own types & remove most object types.
6871
- [ ] Add the hability of importing other files.
6972
- [ ] Add interactive mode (with a REPL).
7073
- [ ] Make a proper std lib.
7174
- [ ] Add for loops.
72-
- [ ] Add local variables.
7375
- [ ] Add a proper break keyword.
7476
- [ ] Add readable error messages.
7577
- [ ] Optimizing the interpreter.
7678
- [ ] Make a compiler.
7779

78-
7980
<!--## How to get it
8081
8182
You can get it from just cloning this repository and then running it (`dotnet run`).<br />
8283
Or you can clone this repository and then install it globally as a dotnet package (`./install_globally.ps1`) and then just use `crit`.<br />
8384
Or download the executable [here](https://github.com/lucascompython/CritLang/releases) and then you can just use that file.-->
8485

86+
## Contributions
8587

86-
87-
## Contributions
88-
Please feel free to help.<br>
88+
Please feel free to help.
8989
All help is appreciated!
9090

91-
9291
## Known Bugs
93-
Right now you can't use arrays inside arrays nor inside dictionaries and vice versa. This will be fixed in the next update.
92+
93+
Right now you can't use arrays inside arrays nor inside dictionaries and vice versa. This will be fixed in the next update.
9494

9595
## License
96+
9697
This project is licensed under the GPL3 license.

0 commit comments

Comments
 (0)