vrtc / pjass (public) (License: BSD) (since 2023-08-03) (hash sha1)
pjass is a free Jass scripting language parser. This repository is a fork of lep/pjass. The goal is to add Debian packaging. As of the time of this writing, it works for current stable, that is Debian 12 (bookworm).
List of commits:
Subject Hash Author Date (UTC)
Better error messages. ad8342582ac3617280f471d889b1766be272858b lep 2017-11-15 17:52:08
Handle wrong shadowing. 0500a60ef11f39c4f33044e26c29798f6d8445b5 lep 2017-02-19 14:37:21
Added checks for natives which behave bad in a globals block. 3e6ac270dda9ad695723d3bc2aac4d69a2fdf87a lep 2017-02-19 10:57:33
Update readme.md 2c9177dd5482ed8c4c1464a4ade37c301205fe6b lep 2017-02-01 17:42:49
Public git release. 2da78f3665ac4f53f5833c6a48ebbeaabea0cd49 lep 2017-02-01 16:42:21
Better ifdef-handling for aligned malloc. d95ebafa7204e49d84a9fed8cdeb01713dd0bc82 lep 2017-02-01 16:41:07
Makefile changes. 0458bb26764aad1caec71ccf721e84a28c699ee0 lep 2017-02-01 15:48:25
Can now compile on freebsd and linux from one branch. 0772c4bd17dcfc389ca0e887b4bbceda8e46fa8e lep 2017-01-07 21:05:10
More descriptive check for assignment. 474462b44fe20e958e8c6a3b51ba2da9c4a46451 lep 2016-11-24 16:47:15
Actually add all the sources to the release zipball 151ae88aac4c3ac8aae432a4a240239f652fa8f4 lep 2016-11-10 15:30:38
Don't treat ``.'' as a valid real value. 72e5087e22af66de0765c6d4f9ceae154725e2c2 lep 2016-10-24 14:55:02
Also split on \r in flag parser. 519d685ab24864716e3a1ecfd797790a327868ca lep 2016-08-28 12:41:08
Improved errors for function-calls. 5a50178a03c5aa3d153e8699070942327fde0b7b lep 2016-08-27 18:44:01
A very strange error with newlines and comments. d822cacbd889fe723102102c8a09d578d90f013e lep 2016-08-21 09:15:00
Added +nosyntaxerror and +nosemanticerror e755e12b3cab1d5069574e34d22633dd420bb230 lep 2016-05-07 13:42:57
MinGW fixes. f579fad932039f1bca43e7612154f5b7dc4aea4f lep 2016-03-13 19:29:36
Added +shadow description to -h 6a62b1ecf773175992a2a430a178fffb5532e467 lep 2016-03-13 19:35:20
Reduced duplicate code from variable decleration. 01d6f01ebf7c2df9f58aea1bba61bae8a270b520 lep 2016-03-13 19:03:34
Added optional variable shadowing warning. 2a0b36f50d2850c4c2ff09f503e6ffad6abf58d9 lep 2016-03-13 14:30:36
Removed the +s and +e<n> flags. 4ab97e853531f2767136602d88c6a86897089eea lep 2016-03-13 10:52:37
Commit ad8342582ac3617280f471d889b1766be272858b - Better error messages.
Now has special error messages for missing 'local' identifier and
when passing arguments to a function literal.
Author: lep
Author date (UTC): 2017-11-15 17:52
Committer name: lep
Committer date (UTC): 2017-11-15 17:52
Parent(s): 0500a60ef11f39c4f33044e26c29798f6d8445b5
Signer:
Signing key:
Signing status: N
Tree: 069b3b0ea9e11efff622f5f890a8d934e8f254c9
File Lines added Lines deleted
grammar.y 46 20
tests/should-check/absolute-garbage.j 1 1
tests/should-fail/code-literal-cant-take-argument.j 7 0
tests/should-fail/code-literal-with-passed-arguments.j 8 0
tests/should-fail/missing-local.j 6 0
File grammar.y changed (mode: 100644) (index 93edad6..c3be76c)
... ... expr: intexpr { $$.ty = gInteger; }
145 145 | realexpr { $$.ty = gReal; } | realexpr { $$.ty = gReal; }
146 146 | stringexpr { $$.ty = gString; } | stringexpr { $$.ty = gString; }
147 147 | boolexpr { $$.ty = gBoolean; } | boolexpr { $$.ty = gBoolean; }
148 | FUNCTION rid { struct funcdecl *fd = ht_lookup(&functions, $2.str);
149 if (fd == NULL) {
150 char ebuf[1024];
151 snprintf(ebuf, 1024, "Undefined function %s", $2.str);
152 getsuggestions($2.str, ebuf, 1024, 1, &functions);
153 yyerrorex(semanticerror, ebuf);
154 $$.ty = gCode;
155 } else {
156 if (fd->p->head != NULL) {
157 char ebuf[1024];
158 snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str);
159 yyerrorex(semanticerror, ebuf);
160 }
161 if( fd->ret == gBoolean) {
162 $$.ty = gCodeReturnsBoolean;
163 } else {
164 $$.ty = gCodeReturnsNoBoolean;
165 }
166 }
167 }
148 | FUNCTION rid LPAREN exprlistcompl RPAREN {
149 struct funcdecl *fd = ht_lookup(&functions, $2.str);
150 if (fd == NULL) {
151 char ebuf[1024];
152 snprintf(ebuf, 1024, "Undefined function %s", $2.str);
153 getsuggestions($2.str, ebuf, 1024, 1, &functions);
154 yyerrorex(semanticerror, ebuf);
155 $$.ty = gCode;
156 } else {
157 char ebuf[1024];
158 if (fd->p->head != NULL) {
159 snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str);
160 }else{
161 snprintf(ebuf, 1024, "Function must not take any arguments when used as code");
162 }
163 yyerrorex(semanticerror, ebuf);
164 if( fd->ret == gBoolean) {
165 $$.ty = gCodeReturnsBoolean;
166 } else {
167 $$.ty = gCodeReturnsNoBoolean;
168 }
169 }
170
171 }
172 | FUNCTION rid {
173 struct funcdecl *fd = ht_lookup(&functions, $2.str);
174 if (fd == NULL) {
175 char ebuf[1024];
176 snprintf(ebuf, 1024, "Undefined function %s", $2.str);
177 getsuggestions($2.str, ebuf, 1024, 1, &functions);
178 yyerrorex(semanticerror, ebuf);
179 $$.ty = gCode;
180 } else {
181 if (fd->p->head != NULL) {
182 char ebuf[1024];
183 snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str);
184 yyerrorex(semanticerror, ebuf);
185 }
186 if( fd->ret == gBoolean) {
187 $$.ty = gCodeReturnsBoolean;
188 } else {
189 $$.ty = gCodeReturnsNoBoolean;
190 }
191 }
192 }
168 193 | TNULL { $$.ty = gNull; } | TNULL { $$.ty = gNull; }
169 194 | expr LEQ expr { checkcomparison($1.ty, $3.ty); $$.ty = gBoolean; } | expr LEQ expr { checkcomparison($1.ty, $3.ty); $$.ty = gBoolean; }
170 195 | expr GEQ expr { checkcomparison($1.ty, $3.ty); $$.ty = gBoolean; } | expr GEQ expr { checkcomparison($1.ty, $3.ty); $$.ty = gBoolean; }
 
... ... endlocalsmarker: /* empty */ { fCurrent = NULL; }
548 573 ; ;
549 574
550 575 lvardecl: LOCAL vardecl { } lvardecl: LOCAL vardecl { }
576 | vardecl { yyerrorex(syntaxerror, "Missing 'local'"); }
551 577 | CONSTANT LOCAL vardecl { yyerrorex(syntaxerror, "Local variables can not be declared constant"); } | CONSTANT LOCAL vardecl { yyerrorex(syntaxerror, "Local variables can not be declared constant"); }
552 578 | typedef { yyerrorex(syntaxerror,"Types can not be extended inside functions"); } | typedef { yyerrorex(syntaxerror,"Types can not be extended inside functions"); }
553 579 ; ;
File tests/should-check/absolute-garbage.j changed (mode: 100644) (index 85d3ef8..cbd740a)
1 //# +nosyntaxerror
1 //# +nosyntaxerror +nosemanticerror
2 2 function foo takes nothing returns nothing function foo takes nothing returns nothing
3 3 asd asd asdfghfhf asd asd asdfghfhf
4 4 asdas dsda fas asdas dsda fas
File tests/should-fail/code-literal-cant-take-argument.j added (mode: 100644) (index 0000000..c2ca7ef)
1
2 function foo takes integer i returns nothing
3 endfunction
4
5 function bar takes nothing returns code
6 return function foo
7 endfunction
File tests/should-fail/code-literal-with-passed-arguments.j added (mode: 100644) (index 0000000..2ce9ae4)
1
2
3 function foo takes integer i returns nothing
4 endfunction
5
6 function bar takes nothing returns code
7 return function foo(3)
8 endfunction
File tests/should-fail/missing-local.j added (mode: 100644) (index 0000000..b11c2a6)
1
2
3 function foo takes nothing returns integer
4 integer i = 2
5 return i*i
6 endfunction
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/pjass

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/pjass

Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/pjass

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main