From 08b8ab9e715eb55ccd0a204024898c63c203a9fa Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 29 Jan 2026 11:27:43 +0100 Subject: [PATCH 1/3] Fix static warnings in standard library. --- src/org/rascalmpl/library/lang/xml/DOM.rsc | 2 +- src/org/rascalmpl/library/util/Monitor.rsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/rascalmpl/library/lang/xml/DOM.rsc b/src/org/rascalmpl/library/lang/xml/DOM.rsc index cd72f90c928..165ca796ae3 100644 --- a/src/org/rascalmpl/library/lang/xml/DOM.rsc +++ b/src/org/rascalmpl/library/lang/xml/DOM.rsc @@ -65,7 +65,7 @@ public default value implode(Node x) { throw "can not implode node"(x); } public Node toXML(node x) = element(none(), getName(x), - [toXML(c) | c <- getChildren(x)] + [attribute(none(),"","") | annos := getAnnotations(x), key <- annos]); + [toXML(c) | c <- getChildren(x)] + [attribute(none(),"","") | annos := getKeywordParameters(x), key <- annos]); public default Node toXML(value x) = charData(" "); diff --git a/src/org/rascalmpl/library/util/Monitor.rsc b/src/org/rascalmpl/library/util/Monitor.rsc index 1108aa4bc4a..59a6f5aec15 100644 --- a/src/org/rascalmpl/library/util/Monitor.rsc +++ b/src/org/rascalmpl/library/util/Monitor.rsc @@ -239,7 +239,7 @@ test bool unfinishedLinesAtTheEndTest() { // repo of issue #2138 test bool printLongUnfinishedLine() { jobStart("job", totalWork=1); - singleString = iprintToString(("" | it + "ab" | i <- [0..1000000])); // avoid concat tree printing in chunks + singleString = iprintToString(("" | it + "ab" | _ <- [0..1000000])); // avoid concat tree printing in chunks println(singleString); jobStep("job", "prog", work=1); println("Done"); From 860347a958ea7fe7c1ca2e6254f7668a4c0efa57 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 29 Jan 2026 15:03:45 +0100 Subject: [PATCH 2/3] Rename variable to more appropriate name. --- src/org/rascalmpl/library/lang/xml/DOM.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/rascalmpl/library/lang/xml/DOM.rsc b/src/org/rascalmpl/library/lang/xml/DOM.rsc index 165ca796ae3..f8790348ff4 100644 --- a/src/org/rascalmpl/library/lang/xml/DOM.rsc +++ b/src/org/rascalmpl/library/lang/xml/DOM.rsc @@ -65,7 +65,7 @@ public default value implode(Node x) { throw "can not implode node"(x); } public Node toXML(node x) = element(none(), getName(x), - [toXML(c) | c <- getChildren(x)] + [attribute(none(),"","") | annos := getKeywordParameters(x), key <- annos]); + [toXML(c) | c <- getChildren(x)] + [attribute(none(),"","") | params := getKeywordParameters(x), key <- params]); public default Node toXML(value x) = charData(" "); From 5078ecb087bbe94daf1682badc3d92c497e96936 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 29 Jan 2026 15:07:36 +0100 Subject: [PATCH 3/3] Fix more 'unused' warnings. --- src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc b/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc index 6aff94d64e0..f41e812d152 100644 --- a/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc +++ b/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc @@ -92,7 +92,7 @@ by the user is necessary. default Box toBox(t:appl(Production p, list[Tree] args), FO opts = fo()) { // the big workhorse switch identifies all kinds of special cases for shapes of // grammar rules, and accidental instances (emptiness, only whitespace, etc.) - Symbol nl = #[\n].symbol; + Symbol _nl = #[\n].symbol; Symbol notNl = #![\n].symbol; switch () { @@ -189,7 +189,7 @@ default Box toBox(t:appl(Production p, list[Tree] args), FO opts = fo()) { // We remove all layout node positions to make the number of children predictable // Comments can be recovered by `layoutDiff`. By not recursing into layout // positions `toBox` becomes more than twice as fast. - case : + case : return NULL(); // if we are given a comment node, then we can format it here for use by layoutDiff @@ -241,7 +241,7 @@ default Box toBox(t:appl(Production p, list[Tree] args), FO opts = fo()) { // if the sort name is statement-like and the structure block-like, we go for // vertical with indentation // program: "begin" Declarations decls {Statement ";"}* body "end" ; - case : + case : return V([ H([*[toBox(p, opts=opts) | Tree p <- elements[0..size(pre)]], toBox(elements[size(pre)], opts=opts)]), I([V([toBox(e, opts=opts) | Tree e <- elements[size(pre)+1..-1]])]),