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
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ tuple[TModel, ModuleStatus] rascalTModelComponent(set[MODID] moduleIds, ModuleSt
if(success){
tagsMap = getTags(pt.header.tags);

if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
ms.messages[mid] ? {} += { Message::info("Ignoring module <mid>", pt.header.name@\loc) };
ms.status[mid] += MStatus::ignored();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void dataDeclaration(Tags tags, Declaration current, list[Variant] variants, Col
adtName = prettyPrintName(userType.name);

tagsMap = getTags(tags);
if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(adtName, "Ignoring declaration of `<adtName>`"));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void collect(Module current, Collector c){

tagsMap = getTags(header.tags);

if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(header.name, "Ignoring module <mname>"));
return;
}
Expand Down Expand Up @@ -159,7 +159,7 @@ void collect(current: (Import) `extend <ImportedModule m> ;`, Collector c){

void collect(current: (Declaration) `<Tags tags> <Visibility visibility> <Type varType> <{Variable ","}+ variables> ;`, Collector c){
tagsMap = getTags(tags);
if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(current, "Ignoring variable declaration"));
return;
}
Expand Down Expand Up @@ -210,7 +210,7 @@ void collect(current: (Declaration) `<Tags tags> <Visibility visibility> anno <T
}

tagsMap = getTags(tags);
if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(current, "Ignoring anno declaration for `<pname>`"));
return;
}
Expand Down Expand Up @@ -265,7 +265,7 @@ void collect(current: (FunctionDeclaration) `<FunctionDeclaration decl>`, Collec
ppfname = prettyPrintName(fname);
modifiers = ["<m>" | m <- signature.modifiers.modifiers];
tagsMap = getTags(decl.tags);
if(ignoreCompiler(tagsMap) && "test" notin modifiers) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(fname, "Ignoring function declaration for `<decl.signature.name>`"));
return;
}
Expand Down Expand Up @@ -711,7 +711,7 @@ void collect(current: (Statement) `return <Statement statement>`, Collector c){
void collect (current: (Declaration) `<Tags tags> <Visibility visibility> alias <QualifiedName name> = <Type base>;`, Collector c){
aliasName = prettyPrintName(name);
tagsMap = getTags(tags);
if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(name, "Ignoring alias declaration for `<aliasName>`"));
return;
}
Expand All @@ -729,7 +729,7 @@ void collect (current: (Declaration) `<Tags tags> <Visibility visibility> alias
aliasName = prettyPrintName(name);
tagsMap = getTags(tags);

if(ignoreCompiler(tagsMap)) {
if(hasIgnoreCompilerTag(tagsMap)) {
c.report(info(name, "Ignoring alias declaration for `<aliasName>`"));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ map[str,str] getTags(Tags tags){
//map[str,str] getTags(Tags tags)
// = ("<tg.name>" : tg has contents ? "<tg.contents.contents>" : "" | tg <- tags.tags);

bool ignoreCompiler(map[str,str] tagsMap)
= !isEmpty(domain(tagsMap) & {"ignore", "Ignore", "ignoreCompiler", "IgnoreCompiler"});
bool hasIgnoreCompilerTag(map[str,str] tagsMap)
= !isEmpty(domain(tagsMap) & {"ignoreCompiler", "IgnoreCompiler"});

bool hasIgnoreTag(map[str,str] tagsMap)
= !isEmpty(domain(tagsMap) & {"ignore", "Ignore"});

tuple[bool, str] getDeprecated(map[str,str] tagsMap){
for(depr <- {"deprecated", "Deprecated"}){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tuple[Tree, TModel] parseConcreteFragments(Tree M, TModel tm, AGrammar gr) {
}
}

ignoredFunctionLocs = {fd@\loc | /FunctionDeclaration fd := M, ignoreCompiler(getTags(fd.tags)) };
ignoredFunctionLocs = {fd@\loc | /FunctionDeclaration fd := M, hasIgnoreCompilerTag(getTags(fd.tags)) };

M = top-down-break visit(M) {
case Tree t:appl(p:prod(label("concrete",sort(/Expression|Pattern/)), _, _),[Tree concrete])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,12 @@ public map[str,str] translateTags(Tags tags){
return m;
}

public bool ignoreCompiler(map[str,str] tagsMap)
= !isEmpty(domain(tagsMap) & {"ignore", "Ignore", "ignoreCompiler", "IgnoreCompiler"});
// public bool hasIgnoreCompilerTag(map[str,str] tagsMap)
// = !isEmpty(domain(tagsMap) & {"ignore", "Ignore", "hasIgnoreCompilerTag", "IgnoreCompiler"});

//private bool ignoreCompilerTest(map[str, str] tags) = !isEmpty(domain(tags) & {"ignoreCompiler", "IgnoreCompiler"});
//private bool hasIgnoreCompilerTagTest(map[str, str] tags) = !isEmpty(domain(tags) & {"hasIgnoreCompilerTag", "IgnoreCompiler"});

public bool ignoreTest(map[str, str] tags) = !isEmpty(domain(tags) & {"ignore", "Ignore", "ignoreCompiler", "IgnoreCompiler"});
// public bool ignoreTest(map[str, str] tags) = !isEmpty(domain(tags) & {"ignore", "Ignore", "hasIgnoreCompilerTag", "IgnoreCompiler"});

/********************************************************************/
/* Translate the modifiers in a function declaration */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ tuple[TModel, MuModule] r2mu(lang::rascal::\syntax::Rascal::Module M, TModel tmo

mtags = translateTags(M.header.tags);
setModuleTags(mtags);
if(ignoreTest(mtags)){
if(hasIgnoreTag(mtags)){
e = info("Ignore tag suppressed compilation", M.header.name@\loc);
tmodel.messages += [e];
return <tmodel, errorMuModule(getRascalModuleName(), {e}, M.header.name@\loc)>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ tuple[int secondsTimeout, int maxSize] getMemoSettings(str memoString){

// Copy from RascalDeclaration, move to separate module

bool ignoreCompiler(map[str,str] tagsMap)
= !isEmpty(domain(tagsMap) & {"ignore", "Ignore", "ignoreCompiler", "IgnoreCompiler"});
bool hasIgnoreCompilerTag(map[str,str] tagsMap)
= !isEmpty(domain(tagsMap) & {"ignore", "Ignore", "hasIgnoreCompilerTag", "IgnoreCompiler"});

str getMemoCache(MuFunction fun)
= "$memo_<asJavaName(getUniqueFunctionName(fun))>";
Expand All @@ -468,7 +468,7 @@ tuple[str constantKwpDefaults, str constantKwpDefaultsInit, JCode jcode] trans(M

if(!jg.isContainedIn(fun.src, jg.getModuleLoc())) return <"", "", "">;

if(ignoreCompiler(fun.tags)) return <"", "", "">;
if(hasIgnoreCompilerTag(fun.tags)) return <"", "", "">;

ftype = fun.ftype;
jg.setFunction(fun);
Expand Down
10 changes: 5 additions & 5 deletions src/org/rascalmpl/library/lang/rascal/tests/library/ValueIO.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module lang::rascal::tests::library::ValueIO

import ValueIO;
import util::UUID;
import util::Reflective;

data Bool(str def = "2") = btrue() | bfalse(bool falsity = true) | band(Bool left, Bool right) | bor(Bool left, Bool right);

Expand Down Expand Up @@ -98,9 +99,8 @@ test bool textSet() = textWriteRead(#set[int], {1,2,3});
test bool textMap() = textWriteRead(#map[int, int], (1:10, 2:20));

test bool textTuple() = textWriteRead(#tuple[int, bool, str], <1,true,"abc">);

@ignore
test bool textAdt() = textWriteRead1(#Bool, band(bor(btrue(),bfalse()),band(btrue(),btrue())));

test bool textAdt() = textWriteRead(#Bool, band(bor(btrue(),bfalse()),band(btrue(),btrue())));


test bool valueText(value v) = textWriteRead(#value, v);
Expand Down Expand Up @@ -148,14 +148,14 @@ loc parsetree1 = |memory://test-tmp/parsetree1-<"<uuidi()>">.test|;

@Ignore{FOR NOW}
test bool writingParseTreeWorks() {
t = parseNamedModuleWithSpaces(|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|);
t = parseModuleWithSpaces(|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|);
writeBinaryValueFile(parsetree1, t);
return readBinaryValueFile(parsetree1) == t;
}

@Ignore{FOR NOW}
test bool writingParseTreeWorksWithoutCompression() {
t = parseNamedModuleWithSpaces(|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|);
t = parseModuleWithSpaces(|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|);
writeBinaryValueFile(parsetree1, t, compression=false);
return readBinaryValueFile(parsetree1) == t;
}
Expand Down
Loading