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)
Added filterreturnsbool check which can be enabled via //# filter 6828cb5e726e7f57cad0ec3f794209c2012c7908 lep 2016-03-03 15:58:59
Moved code into seperate files. 047c531a1c3affb43f53d102c94e765d772ecff3 lep 2016-02-17 20:57:30
Also pack testfiles into the release zip. e2d8ca45c7175b4f0192ddb6202ae71059369495 lep 2016-02-01 15:15:03
Fixed all Warnings. 981e0b8b51eebb4904a42c58c825fa10185f5d23 lep 2016-02-01 15:12:38
Added a test which checks if the utf8-bom can be used as whitespace. cb0ebe275982a65a2ebbd4aca831da4e31739eba lep 2016-01-31 15:04:12
Added utf8 bom as another whitespace token. ea1572ceaa7743fcdff89f206e24540df6358e7b lep 2016-01-31 13:23:27
Added tests to the git repo. 6aca6f760084ee65f8cdd469b18ad5cb37c42ee3 lep 2016-01-17 10:44:56
FreeBsd patches. 6c3acc1dff6ecd5fa486506fabed077be5347afc lep 2016-01-17 10:23:48
Cleaned up string and comment handling in the lexer ebec6e67e248bef82bf92416733b394399c4e1d4 lep 2016-01-17 09:51:44
Added \r, \n (\x10, \x13) as invalid escape characters. 85d0c7e4453c1879bcbc4db8be28527c5ce9f4f7 lep 2016-01-06 13:16:49
Fixed another rare crash. b6edcc3cfd5c1c837318b0efa5ded6f16e86b403 lep 2015-12-21 19:02:41
Fixed various warnings. 6027429ad1895baef4796ac4ae43952ed51f6174 lep 2015-10-28 09:27:40
Added prof target to makefile 9c4b383d3f7416a30a8bde79c735097edaf8d84a lep 2015-10-27 19:14:20
Added gprof support. 374f624967a563dd4c356a3fc104f8ced49fd692 lep 2015-10-27 18:10:13
Changed //! +rb to //# +rb 63af0d3664320cc94ee6e284c308b1983bcfdab2 lep 2015-10-27 17:17:04
Fixed rare segmentation fault. 13a129c8800d306c4117a54cf62cabbb86db3092 lep 2015-10-25 16:11:55
Makefile fixes. 08a5e4d203b0917d78c9fb479ff197d04f473b33 lep 2015-10-25 10:51:12
Makefile improvements (-O3 -flto) 035a361468f060b12bc473e5ec6b0d59db0765d3 lep 2015-10-24 09:16:16
Moved tests into this folder. 099d64a6284a26eafde87ef274c1210455db6f3e lep 2015-10-05 21:29:42
pjass now checks against //! +rb instead of //+rb. Whitespace allowed. 27da8d5250f0b815ef5d8765e0eac766ac4cce6b lep 2015-10-04 21:52:31
Commit 6828cb5e726e7f57cad0ec3f794209c2012c7908 - Added filterreturnsbool check which can be enabled via //# filter
Author: lep
Author date (UTC): 2016-03-03 15:58
Committer name: lep
Committer date (UTC): 2016-03-03 15:58
Parent(s): 047c531a1c3affb43f53d102c94e765d772ecff3
Signer:
Signing key:
Signing status: N
Tree: cc764d41c0ae740568c22f181c554d9c2310cc34
File Lines added Lines deleted
grammar.y 38 28
main.c 50 35
misc.c 49 7
misc.h 17 4
token.l 2 2
File grammar.y changed (mode: 100644) (index 839455d..a2c1f9b)
76 76 %token INTLIT %token INTLIT
77 77 %token REALLIT %token REALLIT
78 78 %token UNITTYPEINT %token UNITTYPEINT
79 %token RETURNBUG
79 %token ANNOTATION
80 80
81 81 %right EQUALS %right EQUALS
82 82 %left AND %left AND
 
... ... expr: intexpr { $$.ty = gInteger; }
155 155 snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str); snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str);
156 156 yyerrorex(3, ebuf); yyerrorex(3, ebuf);
157 157 } }
158 $$.ty = gCode;
158 if( fd->ret == gBoolean) {
159 $$.ty = gCodeReturnsBoolean;
160 } else {
161 $$.ty = gCodeReturnsNoBoolean;
162 }
159 163 } }
160 164 } }
161 165 | TNULL { $$.ty = gNull; } | TNULL { $$.ty = gNull; }
 
... ... funccall: rid LPAREN exprlistcompl RPAREN {
247 251 } }
248 252 if (fd == fCurrent && fCurrent) if (fd == fCurrent && fCurrent)
249 253 yyerrorex(3, "Recursive function calls are not permitted in local declarations"); yyerrorex(3, "Recursive function calls are not permitted in local declarations");
250 checkParameters(fd->p, $3.pl);
254 checkParameters(fd->p, $3.pl, fd == fFilter || fd == fCondition);
251 255 $$.ty = fd->ret; $$.ty = fd->ret;
252 256 } }
253 257 } }
 
... ... funccall: rid LPAREN exprlistcompl RPAREN {
268 272 } else { } else {
269 273 if (fd == fCurrent && fCurrent) if (fd == fCurrent && fCurrent)
270 274 yyerrorex(3, "Recursive function calls are not permitted in local declarations"); yyerrorex(3, "Recursive function calls are not permitted in local declarations");
271 checkParameters(fd->p, $3.pl);
275 checkParameters(fd->p, $3.pl, fd == fCondition || fd == fFilter);
272 276 $$.ty = fd->ret; $$.ty = fd->ret;
273 277 } }
274 278 } }
 
... ... funcdecl: nativefuncdecl { $$.fd = $1.fd; }
308 312
309 313 nativefuncdecl: NATIVE rid TAKES optparam_list RETURNS opttype nativefuncdecl: NATIVE rid TAKES optparam_list RETURNS opttype
310 314 { {
311 if (ht_lookup(&locals, $2.str) || ht_lookup(&params, $2.str) || ht_lookup(&globals, $2.str)) {
312 char buf[1024];
313 snprintf(buf, 1024, "%s already defined as variable", $2.str);
314 yyerrorex(3, buf);
315 } else if (ht_lookup(&types, $2.str)) {
316 char buf[1024];
317 snprintf(buf, 1024, "%s already defined as type", $2.str);
318 yyerrorex(3, buf);
319 }
320 $$.fd = newfuncdecl();
321 $$.fd->name = strdup($2.str);
322 $$.fd->p = $4.pl;
323 $$.fd->ret = $6.ty;
324 //printf("***** %s = %s\n", $2.str, $$.fd->ret->typename);
325 $$.fd->isconst = isconstant;
326 put(&functions, $$.fd->name, $$.fd);
327 //showfuncdecl($$.fd);
315 if (ht_lookup(&locals, $2.str) || ht_lookup(&params, $2.str) || ht_lookup(&globals, $2.str)) {
316 char buf[1024];
317 snprintf(buf, 1024, "%s already defined as variable", $2.str);
318 yyerrorex(3, buf);
319 } else if (ht_lookup(&types, $2.str)) {
320 char buf[1024];
321 snprintf(buf, 1024, "%s already defined as type", $2.str);
322 yyerrorex(3, buf);
323 }
324 $$.fd = newfuncdecl();
325 $$.fd->name = strdup($2.str);
326 $$.fd->p = $4.pl;
327 $$.fd->ret = $6.ty;
328 $$.fd->isconst = isconstant;
329
330 put(&functions, $$.fd->name, $$.fd);
331
332 if( !strcmp("Filter", $$.fd->name) ){
333 fFilter = $$.fd;
334 }else if( !strcmp("Condition", $$.fd->name) ){
335 fCondition = $$.fd;
336 }
337
328 338 } }
329 339 ; ;
330 340
 
... ... funcdefncore: funcbegin localblock codeblock funcend {
337 347 if(retval != gNothing) { if(retval != gNothing) {
338 348 if(!getTypeTag($3.ty)) if(!getTypeTag($3.ty))
339 349 yyerrorline(1, lineno - 1, "Missing return"); yyerrorline(1, lineno - 1, "Missing return");
340 else if (returnbug || fnhasrbannotation)
350 else if ((pjass_flags & flag_rb) || (fnannotations & flag_rb))
341 351 canconvertreturn($3.ty, retval, -1); canconvertreturn($3.ty, retval, -1);
342 352 } }
343 fnhasrbannotation = 0;
353 fnannotations = 0;
344 354 } }
345 | funcbegin localblock codeblock {yyerrorex(0, "Missing endfunction"); ht_clear(&params); ht_clear(&locals); ht_clear(&initialized); curtab = &globals; fnhasrbannotation = 0;}
355 | funcbegin localblock codeblock {yyerrorex(0, "Missing endfunction"); ht_clear(&params); ht_clear(&locals); ht_clear(&initialized); curtab = &globals; fnannotations = 0;}
346 356 ; ;
347 357
348 358 funcend: ENDFUNCTION { ht_clear(&params); ht_clear(&locals); ht_clear(&initialized); curtab = &globals; inblock = 0; inconstant = 0; infunction = 0; } funcend: ENDFUNCTION { ht_clear(&params); ht_clear(&locals); ht_clear(&initialized); curtab = &globals; inblock = 0; inconstant = 0; infunction = 0; }
 
... ... funcbegin: FUNCTION rid TAKES optparam_list returnorreturns opttype {
388 398 } }
389 399 } }
390 400 retval = $$.fd->ret; retval = $$.fd->ret;
391 fnhasrbannotation = rbannotated;
401 fnannotations = annotations;
392 402 inblock = 1; inblock = 1;
393 403 inloop = 0; inloop = 0;
394 404 //showfuncdecl($$.fd); //showfuncdecl($$.fd);
 
... ... statement: newline { $$.ty = gEmpty; }
489 499 $$.ty = mkretty($2.ty, 1); $$.ty = mkretty($2.ty, 1);
490 500 if(retval == gNothing) if(retval == gNothing)
491 501 yyerrorline(1, lineno - 1, "Cannot return value from function that returns nothing"); yyerrorline(1, lineno - 1, "Cannot return value from function that returns nothing");
492 else if (!returnbug && !fnhasrbannotation)
502 else if (!(pjass_flags & flag_rb) && !(fnannotations & flag_rb))
493 503 canconvertreturn($2.ty, retval, 0); canconvertreturn($2.ty, retval, 0);
494 504 } }
495 505 | RETURN newline { | RETURN newline {
 
... ... primtype: HANDLE { $$.ty = ht_lookup(&types, yytext); }
794 804 | CODE { $$.ty = ht_lookup(&types, yytext); } | CODE { $$.ty = ht_lookup(&types, yytext); }
795 805 ; ;
796 806
797 newline: NEWLINE { rbannotated = 0; }
798 | RETURNBUG { rbannotated = 1; }
807 newline: NEWLINE { annotations = 0; }
808 | ANNOTATION { annotations = updateannotation(annotations, yytext); }
799 809 ; ;
File main.c changed (mode: 100644) (index 32d1254..b8a962b)
6 6 #ifndef VERSIONSTR #ifndef VERSIONSTR
7 7 #define VERSIONSTR "1.0-git" #define VERSIONSTR "1.0-git"
8 8 #endif #endif
9 #define ERRORLEVELNUM 4
10 9
11 static struct typenode* addPrimitiveType(const char *name) {
12 struct typenode *new = newtypenode(name, NULL);
13 put(&types, name, new);
14 return new;
10 static struct typenode* addPrimitiveType(const char *name)
11 {
12 struct typenode *newty= newtypenode(name, NULL);
13 put(&types, name, newty);
14 return newty;
15 15 } }
16 16
17 17
18 static void init() {
18 static void init()
19 {
19 20 ht_init(&functions, 8191); ht_init(&functions, 8191);
20 21 ht_init(&globals, 8191); ht_init(&globals, 8191);
21 22 ht_init(&locals, 23); ht_init(&locals, 23);
 
... ... static void init() {
30 31 gString = addPrimitiveType("string"); gString = addPrimitiveType("string");
31 32 gCode = addPrimitiveType("code"); gCode = addPrimitiveType("code");
32 33
34 gCodeReturnsBoolean = newtypenode("codereturnsboolean", gCode);
35 gCodeReturnsNoBoolean = newtypenode("codereturnsboolean", gCode);
36
33 37 gNothing = newtypenode("nothing", NULL); gNothing = newtypenode("nothing", NULL);
34 38 gNull = newtypenode("null", NULL); gNull = newtypenode("null", NULL);
35 39
 
... ... static void init() {
38 42 gEmpty = newtypenode("empty", NULL); gEmpty = newtypenode("empty", NULL);
39 43
40 44 curtab = &globals; curtab = &globals;
45
46 pjass_flags = 0;
47
41 48 fno = 0; fno = 0;
42 49 strict = 0; strict = 0;
43 50 returnbug = 0; returnbug = 0;
44 fnhasrbannotation = 0;
45 rbannotated = 0;
51 fnannotations = 0;
52 annotations = 0;
46 53 haderrors = 0; haderrors = 0;
47 54 ignorederrors = 0; ignorederrors = 0;
48 55 islinebreak = 1; islinebreak = 1;
 
... ... static void init() {
50 57 isconstant = 0; isconstant = 0;
51 58 inconstant = 0; inconstant = 0;
52 59 infunction = 0; infunction = 0;
53 fCurrent = 0;
60
61 fCurrent = NULL;
62 fFilter = NULL;
63 fCondition = NULL;
54 64 } }
55 65
56 static void dofile(FILE *fp, const char *name) {
66 static void dofile(FILE *fp, const char *name)
67 {
57 68 lineno = 1; lineno = 1;
58 69 islinebreak = 1; islinebreak = 1;
59 70 isconstant = 0; isconstant = 0;
 
... ... static void dofile(FILE *fp, const char *name) {
75 86 fno++; fno++;
76 87 } }
77 88
78 static void printversion() {
89 static void printversion()
90 {
79 91 printf("Pjass version %s by Rudi Cilibrasi, modified by AIAndy, PitzerMike, Deaod and lep\n", VERSIONSTR); printf("Pjass version %s by Rudi Cilibrasi, modified by AIAndy, PitzerMike, Deaod and lep\n", VERSIONSTR);
80 92 } }
81 93
82 static void doparse(int argc, char **argv) {
94 static void doparse(int argc, char **argv)
95 {
83 96 int i; int i;
84 97 for (i = 1; i < argc; ++i) { for (i = 1; i < argc; ++i) {
85 98 if (argv[i][0] == '-' && argv[i][1] == 0) { if (argv[i][0] == '-' && argv[i][1] == 0) {
 
... ... printf(
114 127 exit(0); exit(0);
115 128 } }
116 129 if (strcmp(argv[i], "+s") == 0) { if (strcmp(argv[i], "+s") == 0) {
117 strict = 1;
130 pjass_flags |= flag_strict;
118 131 continue; continue;
119 132 } }
120 133 if (strcmp(argv[i], "-s") == 0) { if (strcmp(argv[i], "-s") == 0) {
121 strict = 0;
134 pjass_flags &= ~flag_strict;
122 135 continue; continue;
123 136 } }
124 137 if (strcmp(argv[i], "+rb") == 0) { if (strcmp(argv[i], "+rb") == 0) {
125 returnbug = 1;
138 pjass_flags |= flag_rb;
126 139 continue; continue;
127 140 } }
128 141 if (strcmp(argv[i], "-rb") == 0) { if (strcmp(argv[i], "-rb") == 0) {
129 returnbug = 0;
142 pjass_flags &= ~flag_rb;
130 143 continue; continue;
131 144 } }
132 145
 
... ... printf(
149 162 } }
150 163 int main(int argc, char **argv) int main(int argc, char **argv)
151 164 { {
152 init();
153 doparse(argc, argv);
154
155 if (!haderrors && didparse) {
156 printf("Parse successful: %8d lines: %s\n", totlines, "<total>");
157 if (ignorederrors)
158 printf("%d errors ignored", ignorederrors);
159
160 return 0;
161 }
162 else {
163 if (haderrors)
164 printf("Parse failed: %d error%s total\n", haderrors, haderrors == 1 ? "" : "s");
165 else
166 printf("Parse failed\n");
167 if (ignorederrors)
168 printf("%d errors ignored", ignorederrors);
169 return 1;
170 }
165 init();
166 doparse(argc, argv);
167
168 if (!haderrors && didparse) {
169 printf("Parse successful: %8d lines: %s\n", totlines, "<total>");
170 if (ignorederrors) {
171 printf("%d errors ignored", ignorederrors);
172 }
173
174 return 0;
175 } else {
176 if (haderrors) {
177 printf("Parse failed: %d error%s total\n", haderrors, haderrors == 1 ? "" : "s");
178 } else {
179 printf("Parse failed\n");
180 }
181 if (ignorederrors) {
182 printf("%d errors ignored", ignorederrors);
183 }
184 return 1;
185 }
171 186 } }
File misc.c changed (mode: 100644) (index 3c449d2..f4721e4)
12 12
13 13 #include "misc.h" #include "misc.h"
14 14
15 int pjass_flags;
15 16
16 17 int fno; int fno;
17 18 int lineno; int lineno;
 
... ... int infunction;
25 26 int inblock; int inblock;
26 27 int strict; int strict;
27 28 int returnbug; int returnbug;
28 int fnhasrbannotation;
29 int rbannotated;
29 int fnannotations;
30 int annotations;
30 31 int didparse; int didparse;
31 32 int inloop; int inloop;
32 33 int afterendglobals; int afterendglobals;
 
... ... struct hashtable *curtab;
44 45 const struct typenode *retval; const struct typenode *retval;
45 46 const char *curfile; const char *curfile;
46 47 struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gEmpty; struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gEmpty;
48 struct typenode *gCodeReturnsNoBoolean, *gCodeReturnsBoolean;
47 49 struct typenode *gEmpty; struct typenode *gEmpty;
48 50 struct funcdecl *fCurrent; struct funcdecl *fCurrent;
51 struct funcdecl *fFilter, *fCondition;
49 52
50 53
51 54 void yyerrorline (int errorlevel, int line, const char *s) void yyerrorline (int errorlevel, int line, const char *s)
 
... ... const struct typeandname *getVariable(const char *varname)
222 225 { {
223 226 char ebuf[1024]; char ebuf[1024];
224 227 struct typeandname *result; struct typeandname *result;
228
225 229 result = ht_lookup(&locals, varname); result = ht_lookup(&locals, varname);
226 230 if (result) return result; if (result) return result;
231
227 232 result = ht_lookup(&params, varname); result = ht_lookup(&params, varname);
228 233 if (result) return result; if (result) return result;
234
229 235 result = ht_lookup(&globals, varname); result = ht_lookup(&globals, varname);
230 236 if (result) return result; if (result) return result;
237
231 238 snprintf(ebuf, 1024, "Undeclared variable %s", varname); snprintf(ebuf, 1024, "Undeclared variable %s", varname);
232 239 getsuggestions(varname, ebuf, 1024, 3, &locals, &params, &globals); getsuggestions(varname, ebuf, 1024, 3, &locals, &params, &globals);
233 240 yyerrorline(2, islinebreak ? lineno - 1 : lineno, ebuf); yyerrorline(2, islinebreak ? lineno - 1 : lineno, ebuf);
241
234 242 // Store it as unidentified variable // Store it as unidentified variable
235 243 const struct typeandname *newtan = newtypeandname(gAny, varname); const struct typeandname *newtan = newtypeandname(gAny, varname);
236 244 put(curtab, varname, (void*)newtan); put(curtab, varname, (void*)newtan);
 
... ... const struct typeandname *getVariable(const char *varname)
240 248 return newtan; return newtan;
241 249 } }
242 250
243 void validateGlobalAssignment(const char *varname) {
251 void validateGlobalAssignment(const char *varname)
252 {
244 253 char ebuf[1024]; char ebuf[1024];
245 254 struct typeandname *result; struct typeandname *result;
246 255 result = ht_lookup(&globals, varname); result = ht_lookup(&globals, varname);
 
... ... void validateGlobalAssignment(const char *varname) {
251 260 } }
252 261
253 262
254 void checkParameters(const struct paramlist *func, const struct paramlist *inp)
263 void checkParameters(const struct paramlist *func, const struct paramlist *inp, bool mustretbool)
255 264 { {
256 265 const struct typeandname *fi = func->head; const struct typeandname *fi = func->head;
257 266 const struct typeandname *pi = inp->head; const struct typeandname *pi = inp->head;
 
... ... void checkParameters(const struct paramlist *func, const struct paramlist *inp)
267 276 return; return;
268 277 } }
269 278 canconvert(pi->ty, fi->ty, 0); canconvert(pi->ty, fi->ty, 0);
279 bool has_flag = (pjass_flags & flag_filter) || (fnannotations & flag_filter);
280 if(has_flag && mustretbool && typeeq(pi->ty, gCodeReturnsNoBoolean)){
281 yyerrorex(semanticerror, "Function passed to Filter or Condition must return a boolean");
282 return;
283 }
270 284 pi = pi->next; pi = pi->next;
271 285 fi = fi->next; fi = fi->next;
272 286 } }
 
... ... const struct typenode *binop(const struct typenode *a, const struct typenode *b)
290 304 const struct typenode *combinetype(const struct typenode *n1, const struct typenode *n2) const struct typenode *combinetype(const struct typenode *n1, const struct typenode *n2)
291 305 { {
292 306 uint8_t ret = getTypeTag(n1) & getTypeTag(n2); uint8_t ret = getTypeTag(n1) & getTypeTag(n2);
293 if ((typeeq(n1, gNone)) || (typeeq(n2, gNone))) return mkretty(gNone, ret);
294 if (typeeq(n1, n2)) return mkretty(n1, ret);
307 if ((typeeq(n1, gNone)) || (typeeq(n2, gNone)))
308 return mkretty(gNone, ret);
309 if (typeeq(n1, n2))
310 return mkretty(n1, ret);
295 311 if (typeeq(n1, gNull)) if (typeeq(n1, gNull))
296 312 return mkretty(n2, ret); return mkretty(n2, ret);
297 313 if (typeeq(n2, gNull)) if (typeeq(n2, gNull))
298 314 return mkretty(n1, ret); return mkretty(n1, ret);
315
299 316 n1 = getPrimitiveAncestor(n1); n1 = getPrimitiveAncestor(n1);
300 317 n2 = getPrimitiveAncestor(n2); n2 = getPrimitiveAncestor(n2);
301 if (typeeq(n1, n2)) return mkretty(n1, ret);
318
319 if (typeeq(n1, n2))
320 return mkretty(n1, ret);
302 321 if (typeeq(n1, gNull)) if (typeeq(n1, gNull))
303 322 return mkretty(n2, ret); return mkretty(n2, ret);
304 323 if (typeeq(n2, gNull)) if (typeeq(n2, gNull))
 
... ... void checkeqtest(const struct typenode *a, const struct typenode *b)
439 458 } }
440 459
441 460
461 int updateannotation(int cur, char *txt){
462 char sep[] = " \t\n";
463 char *ann;
464 memset(txt, ' ', strlen("//#"));
465 for(ann = strtok(txt, sep); ann; ann = strtok(NULL, sep)){
466 char *name = ann+1;
467 char sgn = ann[0];
468 int flag = 0;
469
470 if(! strcmp(name, "rb")){
471 flag = flag_rb;
472 } else if(! strcmp(name, "filter") ){
473 flag = flag_filter;
474 }
475
476 if(sgn == '+') {
477 cur |= flag;
478 } else if(sgn == '-') {
479 cur &= ~flag;
480 }
481 }
482 return cur;
483 }
File misc.h changed (mode: 100644) (index 0e2c211..de71687)
... ... enum errortype {
35 35 warning, warning,
36 36 }; };
37 37
38 enum flags {
39 flag_rb = 1 << 0,
40 flag_strict = 1 << 1,
41 flag_filter = 1 << 2,
42 };
43
38 44
39 45 void yyerrorline (int errorlevel, int line, const char *s); void yyerrorline (int errorlevel, int line, const char *s);
40 46 void yyerrorex (int errorlevel, const char *s); void yyerrorex (int errorlevel, const char *s);
 
... ... void getsuggestions(const char*, char*, size_t, int, ...);
46 52
47 53 const struct typenode *binop(const struct typenode *a, const struct typenode *b); const struct typenode *binop(const struct typenode *a, const struct typenode *b);
48 54 const struct typenode *combinetype(const struct typenode *n1, const struct typenode *n2); const struct typenode *combinetype(const struct typenode *n1, const struct typenode *n2);
49 void checkParameters(const struct paramlist *func, const struct paramlist *inp);
55 void checkParameters(const struct paramlist *func, const struct paramlist *inp, bool mustretbool);
50 56 const struct typeandname *getVariable(const char *varname); const struct typeandname *getVariable(const char *varname);
51 int canconvert(const struct typenode *ufrom, const struct typenode *uto, const int linemod);
57
58 void canconvert(const struct typenode *ufrom, const struct typenode *uto, const int linemod);
52 59 void canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, const int linemod); void canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, const int linemod);
53 60
54 61 void validateGlobalAssignment(const char *varname); void validateGlobalAssignment(const char *varname);
 
... ... void checkcomparison(const struct typenode *a, const struct typenode *b);
58 65 void checkcomparisonsimple(const struct typenode *a); void checkcomparisonsimple(const struct typenode *a);
59 66 void checkeqtest(const struct typenode *a, const struct typenode *b); void checkeqtest(const struct typenode *a, const struct typenode *b);
60 67
68 int updateannotation(int cur, char *txt);
69
70 extern int pjass_flags;
71
61 72 extern int fno, lineno, totlines, islinebreak, isconstant, inblock, inconstant, infunction; extern int fno, lineno, totlines, islinebreak, isconstant, inblock, inconstant, infunction;
62 73 extern int haderrors; extern int haderrors;
63 74 extern int ignorederrors; extern int ignorederrors;
 
... ... extern int didparse;
65 76 extern int inloop; extern int inloop;
66 77 extern int strict; extern int strict;
67 78 extern int returnbug; extern int returnbug;
68 extern int fnhasrbannotation;
69 extern int rbannotated;
79 extern int fnannotations;
80 extern int annotations;
70 81 extern int afterendglobals; extern int afterendglobals;
71 82 extern int *showerrorlevel; extern int *showerrorlevel;
72 83 extern char *yytext; extern char *yytext;
 
... ... extern int yydebug;
75 86 int *showerrorlevel; int *showerrorlevel;
76 87 extern struct hashtable functions, globals, locals, params, types, initialized, *curtab; extern struct hashtable functions, globals, locals, params, types, initialized, *curtab;
77 88 extern struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gEmpty; extern struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gEmpty;
89 extern struct typenode *gCodeReturnsNoBoolean, *gCodeReturnsBoolean;
78 90 extern struct funcdecl *fCurrent; extern struct funcdecl *fCurrent;
91 extern struct funcdecl *fFilter, *fCondition;
79 92 extern const struct typenode *retval; extern const struct typenode *retval;
80 93
81 94 #endif #endif
File token.l changed (mode: 100644) (index fd5f044..dd84558)
... ... TABS [\x01-\x09\x0B\x0C\x0E-\x1F]
38 38
39 39 %% %%
40 40
41 {COMMENTSTART}"#"[ \t]*"+rb"[ \t]*{NEWLINE} {
41 {COMMENTSTART}"#".*{NEWLINE} {
42 42 lineno++; lineno++;
43 43 islinebreak = 1; islinebreak = 1;
44 44 isconstant = 0; isconstant = 0;
45 return RETURNBUG;
45 return ANNOTATION;
46 46 } }
47 47
48 48 {COMMENTSTART}.*{NEWLINE} { {COMMENTSTART}.*{NEWLINE} {
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