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)
MinGW fixes. f579fad932039f1bca43e7612154f5b7dc4aea4f lep 2016-03-13 19:29:36
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
Added help target to Makefile a713b03be873950d11e62a7b9e4f2d9a8d2e0945 lep 2016-03-03 16:02:34
Removed strict downcasting check. 5f6ffd725b2ac9d24eff5917d96ceeeaaf748e5f lep 2016-03-03 16:00:49
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
Commit f579fad932039f1bca43e7612154f5b7dc4aea4f - MinGW fixes.
Author: lep
Author date (UTC): 2016-03-13 19:29
Committer name: lep
Committer date (UTC): 2016-03-13 20:19
Parent(s): 01d6f01ebf7c2df9f58aea1bba61bae8a270b520
Signer:
Signing key:
Signing status: N
Tree: 2caff63846408f856748cd9b5f3bd7ac7e0aaebe
File Lines added Lines deleted
Makefile 1 1
hashtable.c 1 1
hashtable.h 4 0
misc.c 17 11
typeandname.c 9 1
typeandname.h 2 0
File Makefile changed (mode: 100644) (index f7552ff..b3d7e84)
1 CFLAGS = -O3 -Wall -Wextra -std=c11 -MMD -Weverything
1 CFLAGS = -O3 -flto -MMD
2 2 VERSION := $(shell git rev-parse --short HEAD) VERSION := $(shell git rev-parse --short HEAD)
3 3
4 4 # when testing and releasing, we can't run both in parallel # when testing and releasing, we can't run both in parallel
File hashtable.c changed (mode: 100644) (index b143313..42cca35)
1 #include <stdlib.h>
1
2 2 #include <string.h> #include <string.h>
3 3 #include <stdlib.h> #include <stdlib.h>
4 4
File hashtable.h changed (mode: 100644) (index 905a180..2185dc1)
1 1 #ifndef HASHTABLE_H #ifndef HASHTABLE_H
2 2 #define HASHTABLE_H #define HASHTABLE_H
3 3
4 // mingw needs this to get a definition of _off_t
5 #include <stdio.h>
6
4 7 #include <stdint.h> #include <stdint.h>
5 8 #include <stdbool.h> #include <stdbool.h>
6 9
10
7 11 struct hashnode { struct hashnode {
8 12 const char *name; const char *name;
9 13 void *val; void *val;
File misc.c changed (mode: 100644) (index 0b7c060..6105584)
... ... static int editdistance(const char *s, const char *t, int cutoff){
109 109 } }
110 110
111 111 int *v[3]; int *v[3];
112 for(int i = 0; i != 3; i++) {
112 int i;
113 for(i = 0; i != 3; i++) {
113 114 v[i] = malloc(sizeof(int) * (size_t)(b+1)); v[i] = malloc(sizeof(int) * (size_t)(b+1));
114 115 } }
115 116
116 for(int i = 0; i != b+1; i++){
117 for(i = 0; i != b+1; i++){
117 118 v[0][i] = i; v[0][i] = i;
118 119 } }
119 120
120 121 int pcur; int pcur;
121 122 int ppcur; int ppcur;
122 123 int cur = 1; int cur = 1;
123 for(int i = 0; i != a; i++){
124 for(i = 0; i != a; i++){
124 125 cur = (cur+1) % 3; cur = (cur+1) % 3;
125 126 pcur = cur -1; pcur = cur -1;
126 127 if(pcur < 0) pcur += 3; if(pcur < 0) pcur += 3;
 
... ... static int editdistance(const char *s, const char *t, int cutoff){
153 154 pcur = cur -1; pcur = cur -1;
154 155 if(pcur < 0) pcur += 3; if(pcur < 0) pcur += 3;
155 156 int d = v[pcur][b]; int d = v[pcur][b];
156 for(int i = 0; i != 3; i++)
157 for(i = 0; i != 3; i++)
157 158 free(v[i]); free(v[i]);
158 159 return d; return d;
159 160 } }
 
... ... void getsuggestions(const char *name, char *buff, size_t buffsize, int nTables,
167 168 int count = 0; int count = 0;
168 169
169 170 struct {int distance; const char *name;} suggestions[3]; struct {int distance; const char *name;} suggestions[3];
170 for(int i = 0; i != 3; i++){
171 int i;
172 for(i = 0; i != 3; i++){
171 173 suggestions[i].distance = INT_MAX; suggestions[i].distance = INT_MAX;
172 174 suggestions[i].name = NULL; suggestions[i].name = NULL;
173 175 } }
174 176
175 177 va_start(ap, nTables); va_start(ap, nTables);
176 178
177 for(int i = 0; i != nTables; i++){
179
180 for(i = 0; i != nTables; i++){
178 181 struct hashtable *ht = va_arg(ap, struct hashtable*); struct hashtable *ht = va_arg(ap, struct hashtable*);
179
180 for(size_t x = 0; x != ht->size; x++){
182
183 size_t x;
184 for(x = 0; x != ht->size; x++){
181 185 if(ht->bucket[x].name){ if(ht->bucket[x].name){
182 186 const struct typeandname *tan = ht->bucket[x].val; const struct typeandname *tan = ht->bucket[x].val;
183 187 if(typeeq(tan->ty, gAny)){ if(typeeq(tan->ty, gAny)){
 
... ... void getsuggestions(const char *name, char *buff, size_t buffsize, int nTables,
187 191 int dist = editdistance(ht->bucket[x].name, name, cutoff); int dist = editdistance(ht->bucket[x].name, name, cutoff);
188 192 if(dist <= cutoff){ if(dist <= cutoff){
189 193 count++; count++;
190 for(int j = 0; j != 3; j++){
194 int j;
195 for(j = 0; j != 3; j++){
191 196 if(suggestions[j].distance > dist){ if(suggestions[j].distance > dist){
192 197 if(i == 0){ if(i == 0){
193 198 suggestions[2] = suggestions[1]; suggestions[2] = suggestions[1];
 
... ... int updateflag(int cur, char *txt, struct hashtable *flags){
469 474 } }
470 475
471 476 int updateannotation(int cur, char *txt, struct hashtable *flags){ int updateannotation(int cur, char *txt, struct hashtable *flags){
472 char sep[] = " \t\n";
477 char sep[] = " \t\r\n";
473 478 memset(txt, ' ', strlen("//#")); memset(txt, ' ', strlen("//#"));
474 for(char *ann = strtok(txt, sep); ann; ann = strtok(NULL, sep)){
479 char *ann;
480 for(ann = strtok(txt, sep); ann; ann = strtok(NULL, sep)){
475 481 cur = updateflag(cur, ann, flags); cur = updateflag(cur, ann, flags);
476 482 } }
477 483 return cur; return cur;
File typeandname.c changed (mode: 100644) (index 6cb071e..b00c032)
3 3
4 4 #include "typeandname.h" #include "typeandname.h"
5 5
6 #if !(defined __CYGWIN__ || defined linux)
7 extern void * _aligned_malloc(size_t size, size_t alignment);
8 #endif
9
6 10 struct typeandname *newtypeandname(const struct typenode *ty, const char *name) struct typeandname *newtypeandname(const struct typenode *ty, const char *name)
7 11 { {
8 12 struct typeandname *tan = calloc(sizeof(struct typeandname), 1); struct typeandname *tan = calloc(sizeof(struct typeandname), 1);
 
... ... struct typeandname *newtypeandname(const struct typenode *ty, const char *name)
15 19 struct typenode *newtypenode(const char *typename, const struct typenode *superclass) struct typenode *newtypenode(const char *typename, const struct typenode *superclass)
16 20 { {
17 21 struct typenode *result; struct typenode *result;
18 result = aligned_alloc(8, sizeof(struct typenode));
22 #if (defined __CYGWIN__ || defined linux)
23 result = memalign(8, sizeof(struct typenode));
24 #else
25 result = _aligned_malloc(8, sizeof(struct typenode));
26 #endif
19 27 result->typename = strdup(typename); result->typename = strdup(typename);
20 28 result->superclass = superclass; result->superclass = superclass;
21 29 return result; return result;
File typeandname.h changed (mode: 100644) (index 58e1d73..c7c2ecb)
1 1 #ifndef TYPEANDNAME_H #ifndef TYPEANDNAME_H
2 2 #define TYPEANDNAME_H #define TYPEANDNAME_H
3 3
4 // mingw needs this to get a definition of _off_t
5 #include <stdio.h>
4 6 #include <stdint.h> #include <stdint.h>
5 7
6 8 struct typenode { struct typenode {
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