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 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
pjass 10i 1ecf3d1238619358a0aa9b1b919ed9ba97d36f84 PitzerMike 2007-09-29 11:57:00
pjass 10h dcb319607e8bb35637f86918962610683ada2b08 PitzerMike 2007-09-13 23:49:00
pjass 10g a5070a4d74abc627160481e592233fa26870d57a PitzerMike 2007-08-24 10:43:00
pjass 10f e6893a0480e2b1c9bb22f39a897a86e8d05123a6 PitzerMike 2007-04-28 08:26:00
Fake commit to cleanup the cvs-import of the pjass sourceforge repo. 7f2ea341ebf2ed939f99ec3b14403025446e25f5 lep 2017-01-11 14:07:30
Commit 82e8d024392d357d56c833c6b7f7632ffd6830a8 - Added early exit to editdistance function.
Author: lep
Author date (UTC): 2015-02-02 16:13
Committer name: lep
Committer date (UTC): 2015-02-02 16:13
Parent(s): f3ef715b90782bc22fbdd29e1c16d7c917f407a9
Signer:
Signing key:
Signing status: N
Tree: da0d9965502585bfae1e6b8a1d0d9c7d1b27c115
File Lines added Lines deleted
grammar.y 2 1
misc.c 25 3
File grammar.y changed (mode: 100644) (index 9173202..91ce712)
... ... expr: intexpr { $$.ty = gInteger; }
267 267 if(infunction && lookup(curtab, $1.str) && !lookup(&initialized, $1.str) ){ if(infunction && lookup(curtab, $1.str) && !lookup(&initialized, $1.str) ){
268 268 char ebuf[1024]; char ebuf[1024];
269 269 sprintf(ebuf, "Variable %s is uninitialized", $1.str); sprintf(ebuf, "Variable %s is uninitialized", $1.str);
270 yyerrorex(3, ebuf);
270 //yyerrorex(3, ebuf);
271 yyerrorline(3, lineno - 1, ebuf);
271 272 } }
272 273 $$.ty = tan->ty; $$.ty = tan->ty;
273 274 } }
File misc.c changed (mode: 100644) (index d74f1c0..365c261)
... ... int min(int a, int b){
87 87 else return b; else return b;
88 88 } }
89 89
90 int editdistance(const char *s, const char *t){
90 int abs(int i){
91 if(i < 0)
92 return -i;
93 return i;
94 }
95
96 int editdistance(const char *s, const char *t, int cutoff){
91 97 if(!strcmp(s, t)) return 0; if(!strcmp(s, t)) return 0;
92 98
93 99 int a = strlen(s); int a = strlen(s);
 
... ... int editdistance(const char *s, const char *t){
95 101
96 102 if(a==0) return b; if(a==0) return b;
97 103 if(b==0) return a; if(b==0) return a;
104
105 if(abs(a-b) > cutoff){
106 return cutoff + 1;
107 }
98 108
99 109 int *v[3]; int *v[3];
100 110 int i; int i;
 
... ... int editdistance(const char *s, const char *t){
115 125 if(ppcur < 0) ppcur += 3; if(ppcur < 0) ppcur += 3;
116 126
117 127 v[cur][0] = i + 1; v[cur][0] = i + 1;
128
129 int minDistance = INT_MAX;
130
118 131 int j; int j;
119 132 for(j = 0; j != b; j++){ for(j = 0; j != b; j++){
120 133 int cost = (s[i] == t[j]) ? 0 : 1; int cost = (s[i] == t[j]) ? 0 : 1;
134
121 135 v[cur][j+1] = min(v[cur][j] + 1, min(v[pcur][j+1] + 1, v[pcur][j] + cost)); v[cur][j+1] = min(v[cur][j] + 1, min(v[pcur][j+1] + 1, v[pcur][j] + cost));
122
136
123 137 if(i > 0 && j > 0 && s[i] == t[j-1] && s[i-1] == t[j]){ if(i > 0 && j > 0 && s[i] == t[j-1] && s[i-1] == t[j]){
124 138 v[cur][j+1] = min(v[cur][j+1], v[ppcur][j-1] + cost); v[cur][j+1] = min(v[cur][j+1], v[ppcur][j-1] + cost);
125 139 } }
140
141 if(v[cur][j+1] < minDistance){
142 minDistance = v[cur][j+1];
143 }
144 }
145
146 if(minDistance > cutoff){
147 return cutoff + 1;
126 148 } }
127 149 } }
128 150 pcur = cur -1; pcur = cur -1;
 
... ... void getsuggestions(const char *name, char *buff, int nTables, ...){
155 177 struct hashnode *hn; struct hashnode *hn;
156 178 hn = ht->h[x]; hn = ht->h[x];
157 179 while (hn) { while (hn) {
158 int dist = editdistance(hn->name, name);
180 int dist = editdistance(hn->name, name, cutoff);
159 181 if(dist <= cutoff){ if(dist <= cutoff){
160 182 count++; count++;
161 183 int j; int j;
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