From 1e515453fd1da0304a3365c69f784a75458386b8 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Wed, 30 Oct 2024 17:14:14 +0100 Subject: [PATCH 1/5] Updating to latest rascal and rascal-maven-plugin --- .gitignore | 1 - RELEASE-NOTES.md | 2 ++ pom.xml | 5 ++--- .../rascal/lang/php/util/{Config.rsc-dist => Config.rsc} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename src/main/rascal/lang/php/util/{Config.rsc-dist => Config.rsc} (100%) diff --git a/.gitignore b/.gitignore index e389ce7..2e4f0c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .idea -Config.rsc # Files generated for Rascal resources src/*.rsc diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e69de29..5375914 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -0,0 +1,2 @@ +# to be written + diff --git a/pom.xml b/pom.xml index 91ec067..7c84279 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ org.rascalmpl rascal - 0.40.4 + 0.40.14 edu.appstate.cs @@ -136,9 +136,8 @@ org.rascalmpl rascal-maven-plugin - 0.27.5 + 0.28.8 - true false ${project.build.outputDirectory} diff --git a/src/main/rascal/lang/php/util/Config.rsc-dist b/src/main/rascal/lang/php/util/Config.rsc similarity index 100% rename from src/main/rascal/lang/php/util/Config.rsc-dist rename to src/main/rascal/lang/php/util/Config.rsc From fc7b70c30d3f41c624df486dbfc1a902c8c2c638 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Thu, 31 Oct 2024 12:09:44 +0100 Subject: [PATCH 2/5] Removed doubly-defined function that was unused --- src/main/rascal/lang/php/stats/Unfriendly.rsc | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/main/rascal/lang/php/stats/Unfriendly.rsc b/src/main/rascal/lang/php/stats/Unfriendly.rsc index 954b26b..839b903 100644 --- a/src/main/rascal/lang/php/stats/Unfriendly.rsc +++ b/src/main/rascal/lang/php/stats/Unfriendly.rsc @@ -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: "); - for (e <- extra) println("Extra: "); -} - public str generalFeatureSquiglies(FMap featsMap) { labels = getFeatureLabels(); groups = getFeatureGroups(); @@ -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: "); - for (e <- extra) println("Extra: "); -} - public tuple[set[FeatureNode],set[str],int] minimumFeaturesForPercent(FMap fmap, FeatureLattice lattice, int targetPercent) { println("Calculating coverage needed for %"); From f1b3a08a2392f7e9d2f119e3f668231eff6dc4ad Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Thu, 31 Oct 2024 12:09:55 +0100 Subject: [PATCH 3/5] Fixed constructor name --- src/main/rascal/lang/php/analysis/cfg/BuildCFG.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/rascal/lang/php/analysis/cfg/BuildCFG.rsc b/src/main/rascal/lang/php/analysis/cfg/BuildCFG.rsc index 2ebae93..2eb8af8 100644 --- a/src/main/rascal/lang/php/analysis/cfg/BuildCFG.rsc +++ b/src/main/rascal/lang/php/analysis/cfg/BuildCFG.rsc @@ -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); @@ -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 }; } From c731909031dfb0b77ee87ac584c33c9a3814d12b Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Thu, 31 Oct 2024 12:10:02 +0100 Subject: [PATCH 4/5] Removed code clone --- src/main/rascal/lang/php/stats/Stats.rsc | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/main/rascal/lang/php/stats/Stats.rsc b/src/main/rascal/lang/php/stats/Stats.rsc index 1710d1d..22953e6 100644 --- a/src/main/rascal/lang/php/stats/Stats.rsc +++ b/src/main/rascal/lang/php/stats/Stats.rsc @@ -520,28 +520,6 @@ public map[str Product, str Version] getLatestPHP5VersionsByDate() { return ( p : last(v5l)[0] | p <- versions<0>, v5l := sort([ | <- 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([ | <- 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([ | <- 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([ | <- 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>); From fee15b3d3a8f63d1df82ca8c1fcd0d7fa4e4dadf Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Thu, 7 Nov 2024 12:41:51 +0100 Subject: [PATCH 5/5] Updating to latest rascal and rascal-maven-plugin --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7c84279..ec6d5e3 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ org.rascalmpl rascal - 0.40.14 + 0.40.17 edu.appstate.cs @@ -136,7 +136,7 @@ org.rascalmpl rascal-maven-plugin - 0.28.8 + 0.28.9 false ${project.build.outputDirectory}