Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.idea
Config.rsc

# Files generated for Rascal resources
src/*.rsc
Expand Down
2 changes: 2 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# to be written

5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>org.rascalmpl</groupId>
<artifactId>rascal</artifactId>
<version>0.40.4</version>
<version>0.40.17</version>
</dependency>
<dependency>
<groupId>edu.appstate.cs</groupId>
Expand Down Expand Up @@ -136,9 +136,8 @@
<plugin>
<groupId>org.rascalmpl</groupId>
<artifactId>rascal-maven-plugin</artifactId>
<version>0.27.5</version>
<version>0.28.9</version>
<configuration>
<errorsAsWarnings>true</errorsAsWarnings>
<enableStandardLibrary>false</enableStandardLibrary>
<bin>${project.build.outputDirectory}</bin>
<srcs>
Expand Down
4 changes: 2 additions & 2 deletions src/main/rascal/lang/php/analysis/cfg/BuildCFG.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public set[Lab] init(Stmt s, LabelState lstate) {
case unset(list[Expr] unsetVars) : return init(head(unsetVars), lstate);

// A use statement is atomic.
case use(_,_,_) : return { s.lab };
case useStmt(_,_,_) : return { s.lab };

// In a while loop, the while condition is executed first and thus provides the first label.
case \while(Expr cond, _) : return init(cond, lstate);
Expand Down Expand Up @@ -836,7 +836,7 @@ private set[Lab] final(Stmt s, LabelState lstate) {
}

// A use is treated as a unit
case use(_,_,_) : {
case useStmt(_,_,_) : {
return { s.lab };
}

Expand Down
22 changes: 0 additions & 22 deletions src/main/rascal/lang/php/stats/Stats.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -520,28 +520,6 @@ public map[str Product, str Version] getLatestPHP5VersionsByDate() {
return ( p : last(v5l)[0] | p <- versions<0>, v5l := sort([ <v,d> | <v,d,pv,_> <- versions[p], "5" == pv[0] ],bool(tuple[str,str] t1, tuple[str,str] t2) { return t1[1] < t2[1]; }), !isEmpty(v5l) );
}

public map[str Product, str Version] getLatestVersionsByVersionNumber() {
versions = loadVersionsCSV();
return ( p : last(vl)[0] | p <- versions<0>, vl := sort([ <v,d> | <v,d,_,_> <- versions[p] ],bool(tuple[str,str] t1, tuple[str,str] t2) { return compareVersion(t1[0],t2[0]); }) );
}

public map[str Product, str Version] getLatestPHP4VersionsByVersionNumber() {
versions = loadVersionsCSV();
return ( p : last(v4l)[0] | p <- versions<0>, v4l := sort([ <v,d> | <v,d,pv,_> <- versions[p], "4" == pv[0] ],bool(tuple[str,str] t1, tuple[str,str] t2) { return compareVersion(t1[0], t2[0]); }), !isEmpty(v4l) );
}

public map[str Product, str Version] getLatestPHP5VersionsByVersionNumber() {
versions = loadVersionsCSV();
return ( p : last(v5l)[0] | p <- versions<0>, v5l := sort([ <v,d> | <v,d,pv,_> <- versions[p], "5" == pv[0] ],bool(tuple[str,str] t1, tuple[str,str] t2) { return compareVersion(t1[0],t2[0]); }), !isEmpty(v5l) );
}

public map[str Product, str Version] getLatestVersions() = getLatestVersionsByVersionNumber();

public map[str Product, str Version] getLatestPHP4Versions() = getLatestPHP4VersionsByVersionNumber();

public map[str Product, str Version] getLatestPHP5Versions() = getLatestPHP5VersionsByVersionNumber();


public str getPHPVersion(str product, str version) {
versions = loadVersionsCSV();
return getOneFrom(versions[product,version,_]<0>);
Expand Down
31 changes: 0 additions & 31 deletions src/main/rascal/lang/php/stats/Unfriendly.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -1165,16 +1165,6 @@ public str groupsTable() = groupsTable({},{},{});

public list[str] getFeatureLabels() = [ l | \map(_,rtype) := #FMap.symbol, /Type::label(l,_) := rtype ];

public void checkGroups() {
labels = getFeatureLabels();
groups = getFeatureGroups();
//keys = [rascalFriendlyKey(k) | k <- (exprKeyOrder()+stmtKeyOrder())];
missing = {*labels} - {*groups[g] | g <- groups};
extra = {*groups[g] | g <- groups} - {*labels};
for (m <- missing) println("Missing: <m>");
for (e <- extra) println("Extra: <e>");
}

public str generalFeatureSquiglies(FMap featsMap) {
labels = getFeatureLabels();
groups = getFeatureGroups();
Expand Down Expand Up @@ -1419,27 +1409,6 @@ public FeatureLattice calculateTransitiveFiles(FeatureLattice lattice, FeatureNo
return lattice;
}

public void checkGroups() {
labels = [ l | \map(_,rtype) := #FMap.symbol, /Type::label(l,_) := rtype ];
groups = ("binary ops" : [ l | str l:/^binaryOp.*/ <- labels ])
+ ("unary ops" : [l | str l:/^unaryOp.*/ <- labels ])
+ ("control flow" : ["break","continue","declare","do","for","foreach","goto","if","return","switch","throw","tryCatch","while","exit","suppress","label"])
+ ("assignment ops" : [l | str l:/^assign.*/ <-labels] + ["listAssign","refAssign", "unset"])
+ ("definitions" : ["functionDef","interfaceDef","traitDef","classDef","namespace","global","static","const","use","include","closure"])
+ ("invocations" : ["call","methodCall","staticCall", "eval", "shellExec"])
+ ("allocations" : ["array","new","scalar", "clone"])
+ ("casts" : [l | str l:/^cast.*/ <- labels])
+ ("print" : ["print","echo","inlineHTML" ])
+ ("predicates" : ["isSet","empty","instanceOf"])
+ ("lookups" : ["fetchArrayDim","fetchClassConst","var","classConst","fetchConst","propertyFetch","fetchStaticProperty"])
;
keys = [rascalFriendlyKey(k) | k <- (exprKeyOrder()+stmtKeyOrder())];
missing = toSet(keys) - {*g|g<-groups<1>};
extra = {*g|g<-groups<1>} - toSet(keys);
for (m <- missing) println("Missing: <m>");
for (e <- extra) println("Extra: <e>");
}

public tuple[set[FeatureNode],set[str],int] minimumFeaturesForPercent(FMap fmap, FeatureLattice lattice, int targetPercent) {
println("Calculating coverage needed for <targetPercent>%");

Expand Down
Loading