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)
Wrapped typenode member accesses in getTypePtr. 372c1f9da68a65de9e14dff3881e1758d5e7114b lep 2015-02-03 21:05:11
Added ifdefs for memalign functionality. f005f5e8067994ebd76265e3289e6ab67283b96f lep 2015-02-03 20:06:20
Missing-return check in elseifs should work now. 4274d6166e2c92a4591c1e46a0d71f1579a57c7d lep 2015-02-03 19:35:39
Missing-return checks also checks elseifs. 889122b0fb788663c728127520d0e7124c2a040c lep 2015-02-03 15:18:12
Fixed some more warnings. a5ae36b5299ac419a91592b60b8fcb1dfd8f4374 lep 2015-02-03 13:24:56
Added early exit to editdistance function. 82e8d024392d357d56c833c6b7f7632ffd6830a8 lep 2015-02-02 16:13:40
Unidentified variables are now marked as initialized. f3ef715b90782bc22fbdd29e1c16d7c917f407a9 lep 2015-02-02 13:56:00
Fixed bug in editdistance. a786775b057fc5795db1b2b106b7b9e3c1df6c4c lep 2015-02-02 13:41:15
Added basic uninitialized variable check for locals. c8222a6f68e44a46624c1f9ee781f590522f45f6 lep 2015-02-02 12:41:25
Added git-versionstring. e13ce6d7d90bccd8e18de6d0b01a18ea4501862b lep 2015-02-01 14:56:01
Removed returnsbool-check for Filter/Condition. e26a973fe1fdc1af999633c8d1f29afcbae76f0b lep 2015-02-01 14:51:47
Fixed some bison warnings. aca6b13e73d95c41787a7a0fdcc33407247be3a8 lep 2015-02-01 14:49:55
Removed multiline comments. e6d3a1bb5099bbf6e3a4ef2501645b15908a1ce8 lep 2015-02-01 14:49:16
Removed unnecessary tokens. 4f37057dfd472c2a400d667a6f7a3762cac01dcd lep 2015-02-01 14:48:14
Comments now work with EOF in addition to newlines at the end. 5363d3ca429da30594f7afb9d351335912b03fbd lep 2015-02-01 14:46:09
pjass 10n 2b2d35bc58dc93bc68014711cda919cecff13b4a lep 2014-10-25 20:38:00
pjass 10m 265bac6343dfeb09e1fc0af5c06571c7dc172455 Deaod 2010-02-15 12:15:00
pjass 10l 0c9161120896904b55b3cdd7b2f7430dd97f82e9 PitzerMike 2009-06-15 21:30:00
pjass 10k 43c1a8a167cdf2982af2c47056beeafcd1840537 Zoxc 2009-04-03 21:23:00
pjass 10j 16bbe625b7670a7affcf495e3370224c30582bca PitzerMike 2007-10-09 09:22:00
Commit 372c1f9da68a65de9e14dff3881e1758d5e7114b - Wrapped typenode member accesses in getTypePtr.
Author: lep
Author date (UTC): 2015-02-03 21:05
Committer name: lep
Committer date (UTC): 2015-02-03 21:05
Parent(s): f005f5e8067994ebd76265e3289e6ab67283b96f
Signer:
Signing key:
Signing status: N
Tree: b34f5426e381db5f2c28ef1bf45fc494b01ab359
File Lines added Lines deleted
grammar.y 1 1
misc.c 15 15
misc.h 3 0
File grammar.y changed (mode: 100644) (index 6b3bbeb..de8db7b)
... ... expr: intexpr { $$.ty = gInteger; }
234 234 | funccall { $$.ty = $1.ty; } | funccall { $$.ty = $1.ty; }
235 235 | rid LBRACKET expr RBRACKET { | rid LBRACKET expr RBRACKET {
236 236 const struct typeandname *tan = getVariable($1.str); const struct typeandname *tan = getVariable($1.str);
237 if (tan->ty != gAny) {
237 if (!typeeq(tan->ty, gAny)) {
238 238 if (!tan->isarray) { if (!tan->isarray) {
239 239 char ebuf[1024]; char ebuf[1024];
240 240 sprintf(ebuf, "%s not an array", $1.str); sprintf(ebuf, "%s not an array", $1.str);
File misc.c changed (mode: 100644) (index d7b00b8..54f5583)
... ... struct funcdecl *newfuncdecl()
298 298
299 299 const struct typenode *getPrimitiveAncestor(const struct typenode *cur) const struct typenode *getPrimitiveAncestor(const struct typenode *cur)
300 300 { {
301 while (cur->superclass)
302 cur = cur->superclass;
301 while (getTypePtr(cur)->superclass)
302 cur = getTypePtr(cur)->superclass;
303 303 return cur; return cur;
304 304 } }
305 305
 
... ... int isDerivedFrom(const struct typenode *cur, const struct typenode *base)
307 307 { {
308 308 do { do {
309 309 if (typeeq(cur, base)) return 1; if (typeeq(cur, base)) return 1;
310 cur = cur->superclass;
310 cur = getTypePtr(cur)->superclass;
311 311 } while (cur); } while (cur);
312 312 return 0; return 0;
313 313 } }
 
... ... void showtypenode(const struct typenode *td)
319 319 char *extends = ""; char *extends = "";
320 320 char ebuf[1024]; char ebuf[1024];
321 321 assert(td); assert(td);
322 assert(td->typename);
322 assert(getTypePtr(td)->typename);
323 323 /* /*
324 324 if (td->superclass) { if (td->superclass) {
325 325 sprintf(ebuf, " extends %s", td->superclass->typename); sprintf(ebuf, " extends %s", td->superclass->typename);
326 326 extends = ebuf; extends = ebuf;
327 327 } }
328 328 */ */
329 printf("%s %s \n", td->typename, extends);
329 printf("%s %s \n", getTypePtr(td)->typename, extends);
330 330 } }
331 331
332 332 void showfuncdecl(struct funcdecl *fd) void showfuncdecl(struct funcdecl *fd)
 
... ... int canconvert(const struct typenode *ufrom, const struct typenode *uto, const i
434 434 return 1; return 1;
435 435 //if (isDerivedFrom(to, from)) //if (isDerivedFrom(to, from))
436 436 // return 1; // blizzard bug allows downcasting erroneously, we don't support this though // return 1; // blizzard bug allows downcasting erroneously, we don't support this though
437 if (from->typename == NULL || to->typename == NULL)
437 if (getTypePtr(from)->typename == NULL || getTypePtr(to)->typename == NULL)
438 438 return 0; return 0;
439 439 if (typeeq(from, gNone) || typeeq(to, gNone)) if (typeeq(from, gNone) || typeeq(to, gNone))
440 440 return 0; return 0;
 
... ... int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, c
472 472 return 1; // eg. from = unit, to = handle return 1; // eg. from = unit, to = handle
473 473 //if (isDerivedFrom(to, from)) //if (isDerivedFrom(to, from))
474 474 // return 1; // blizzard bug allows downcasting erroneously, we don't support this though // return 1; // blizzard bug allows downcasting erroneously, we don't support this though
475 if (from->typename == NULL || to->typename == NULL)
475 if (getTypePtr(from)->typename == NULL || getTypePtr(to)->typename == NULL)
476 476 return 0; // garbage return 0; // garbage
477 477 if (typeeq(from, gNone) || typeeq(to, gNone)) if (typeeq(from, gNone) || typeeq(to, gNone))
478 478 return 0; // garbage return 0; // garbage
 
... ... int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, c
481 481 to = getPrimitiveAncestor(to); to = getPrimitiveAncestor(to);
482 482 if ((typeeq(to, gReal)) && (typeeq(from, gInteger))) { if ((typeeq(to, gReal)) && (typeeq(from, gInteger))) {
483 483 // can't return integer when it expects a real (added 9.5.2005) // can't return integer when it expects a real (added 9.5.2005)
484 sprintf(ebuf, "Cannot convert returned value from %s to %s", from->typename, to->typename);
484 sprintf(ebuf, "Cannot convert returned value from %s to %s", getTypePtr(from)->typename, getTypePtr(to)->typename);
485 485 yyerrorline(1, lineno + linemod, ebuf); yyerrorline(1, lineno + linemod, ebuf);
486 486 return 0; return 0;
487 487 } }
 
... ... int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, c
494 494 } else if (typeeq(from, to)) } else if (typeeq(from, to))
495 495 return 1; return 1;
496 496
497 sprintf(ebuf, "Cannot convert returned value from %s to %s", ufrom->typename, uto->typename);
497 sprintf(ebuf, "Cannot convert returned value from %s to %s", getTypePtr(ufrom)->typename, getTypePtr(uto)->typename);
498 498 yyerrorline(1, lineno + linemod, ebuf); yyerrorline(1, lineno + linemod, ebuf);
499 499 return 0; return 0;
500 500 } }
 
... ... void isnumeric(const struct typenode *ty)
578 578 void checkcomparisonsimple(const struct typenode *a) { void checkcomparisonsimple(const struct typenode *a) {
579 579 const struct typenode *pa; const struct typenode *pa;
580 580 pa = getPrimitiveAncestor(a); pa = getPrimitiveAncestor(a);
581 if (pa == gString || pa == gHandle || pa == gCode || pa == gBoolean) {
581 if (typeeq(pa, gString) || typeeq(pa, gHandle) || typeeq(pa, gCode) || typeeq(pa, gBoolean)) {
582 582 yyerrorex(3, "Comparing the order/size of 2 variables only works on reals and integers"); yyerrorex(3, "Comparing the order/size of 2 variables only works on reals and integers");
583 583 return; return;
584 584 } }
585 if (pa == gNull)
585 if (typeeq(pa, gNull))
586 586 yyerrorex(3, "Comparing null is not allowed"); yyerrorex(3, "Comparing null is not allowed");
587 587 } }
588 588
 
... ... void checkcomparison(const struct typenode *a, const struct typenode *b)
591 591 const struct typenode *pa, *pb; const struct typenode *pa, *pb;
592 592 pa = getPrimitiveAncestor(a); pa = getPrimitiveAncestor(a);
593 593 pb = getPrimitiveAncestor(b); pb = getPrimitiveAncestor(b);
594 if (pa == gString || pa == gHandle || pa == gCode || pa == gBoolean || pb == gString || pb == gCode || pb == gHandle || pb == gBoolean) {
594 if (typeeq(pa, gString) || typeeq(pa, gHandle) || typeeq(pa, gCode) || typeeq(pa, gBoolean) || typeeq(pb, gString) || typeeq(pb, gCode) || typeeq(pb, gHandle) || typeeq(pb, gBoolean)) {
595 595 yyerrorex(3, "Comparing the order/size of 2 variables only works on reals and integers"); yyerrorex(3, "Comparing the order/size of 2 variables only works on reals and integers");
596 596 return; return;
597 597 } }
598 if (pa == gNull && pb == gNull)
598 if (typeeq(pa, gNull) && typeeq(pb, gNull))
599 599 yyerrorex(3, "Comparing null is not allowed"); yyerrorex(3, "Comparing null is not allowed");
600 600 } }
601 601
 
... ... void checkeqtest(const struct typenode *a, const struct typenode *b)
604 604 const struct typenode *pa, *pb; const struct typenode *pa, *pb;
605 605 pa = getPrimitiveAncestor(a); pa = getPrimitiveAncestor(a);
606 606 pb = getPrimitiveAncestor(b); pb = getPrimitiveAncestor(b);
607 if ((pa == gInteger || pa == gReal) && (pb == gInteger || pb == gReal))
607 if ((typeeq(pa, gInteger) || typeeq(pa, gReal)) && (typeeq(pb, gInteger) || typeeq(pb, gReal)))
608 608 return; return;
609 if (pa == gNull || pb == gNull)
609 if (typeeq(pa, gNull) || typeeq(pb, gNull))
610 610 return; return;
611 611 if (!typeeq(pa, pb)) { if (!typeeq(pa, pb)) {
612 612 yyerrorex(3, "Comparing two variables of different primitive types (except real and integer) is not allowed"); yyerrorex(3, "Comparing two variables of different primitive types (except real and integer) is not allowed");
File misc.h changed (mode: 100644) (index 9603d7a..71dc23c)
... ... struct typenode *binop(const struct typenode *a, const struct typenode *b);
78 78 int canconvert(const struct typenode *from, const struct typenode *to, const int linemod); int canconvert(const struct typenode *from, const struct typenode *to, const int linemod);
79 79 int canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod); int canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod);
80 80 struct typenode* mkretty(struct typenode *ty, int ret); struct typenode* mkretty(struct typenode *ty, int ret);
81 struct typenode* getTypePtr(struct typenode *ty);
82 getTypeTag(struct typenode *ty);
83 int typeeq(struct typenode*, struct typenode*);
81 84 struct typenode *combinetype(struct typenode *n1, struct typenode *n2); struct typenode *combinetype(struct typenode *n1, struct typenode *n2);
82 85 void checkParameters(const struct paramlist *func, const struct paramlist *inp); void checkParameters(const struct paramlist *func, const struct paramlist *inp);
83 86 void validateGlobalAssignment(const char *varname); void validateGlobalAssignment(const char *varname);
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