File tree Expand file tree Collapse file tree 4 files changed +141
-210
lines changed Expand file tree Collapse file tree 4 files changed +141
-210
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,6 @@ CritLang/bin
22CritLang /obj
33.vs
44crit.exe
5+ CritLang /Properties /PublishProfiles /FolderProfile.pubxml
6+ CritLang /Properties /PublishProfiles /FolderProfile.pubxml.user
7+ CritLang /CritLang.csproj.user
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ assignment: IDENTIFIER '=' expression;
2020functionCall : IDENTIFIER ' (' (expression (' ,' expression)*)? ' )' ;
2121
2222expression
23- : constant #constantExpression
23+ : constant (index)* #constantExpression
2424 | IDENTIFIER #identifierExpression
2525 | functionCall #functionCallExpression
2626 | ' (' expression ' )' #parenthesizedExpression
@@ -40,12 +40,14 @@ boolOp: BOOL_OPERATOR;
4040
4141BOOL_OPERATOR : ' and' | ' or' | ' xor' ;
4242
43- constant : INTEGER | FLOAT | STRING | BOOL | NULL ;
43+ constant : INTEGER | FLOAT | STRING | BOOL | array | NULL ;
4444
4545INTEGER : [0-9]+;
4646FLOAT : [0-9]+ ' .' [0-9]+;
4747STRING : (' "' ~' "' * ' "' ) | (' \' ' ~' \' ' * ' \' ' );
4848BOOL : ' true' | ' false' ;
49+ array : ' [' (constant (' ,' constant)*)? ' ]' ;
50+ index : ' [' INTEGER ' ]' ;
4951NULL : ' null' ;
5052
5153
Original file line number Diff line number Diff line change 1- i = 1;
2- name = "Lucas";
3- Write("Hello " + name + "!\n");
4- j = i + 1;
5-
6- if j < i {
7- WriteLine("J is smaller than i");
8- }
9- else if 4 > 5 {
10- WriteLine("4 is bigger than 5");
11- }
12- else {
13- WriteLine("ELSE");
14- }
15-
16- #COMMENT
17-
18- until i > 10
19- {
20- WriteLine("I isn't big eneugh" + i + ".");
21- i = i + 1;
22-
23- }
24- else {
25- WriteLine("I is already big enough" + i + ".");
26- }
27-
28- WriteLine("I: " + i + ".");
1+ WriteLine("Hello, World!")
You can’t perform that action at this time.
0 commit comments