Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TC aware of ignore and ignoreCompiler #754

Closed
PaulKlint opened this issue Jan 10, 2015 · 1 comment
Closed

Make TC aware of ignore and ignoreCompiler #754

PaulKlint opened this issue Jan 10, 2015 · 1 comment

Comments

@PaulKlint
Copy link
Member

The dozens of new tests related to keyword parameters cannot yet be handled by the type checker and compiler. Unfortunately these new tests cause type checker/compiler to fail and this impedes further testing and development of other features.

Now seems therefore a good moment to finally make the type checker aware of ignore and ignoreCompiler tags. Basic idea: if the tag is present the type checker ignores the entire declaration. For the moment it is enough to do this for function and data declarations only.

I have prototyped the code, but prefer that @mahills puts it in the type checker in order to avoid conflicts etc.

private bool ignoreDeclaration(Tags tags){
    map[str,str] getTags(Tags tags){
       m = ();
       for(tg <- tags.tags){
         str name = "<tg.name>";
         if(tg is \default){
            cont = "<tg.contents>"[1 .. -1];
            m[name] = cont;
         } else if (tg is empty)
            m[name] = "";
         else
            m[name] = "<tg.expression>"[1 .. -1];
       }
       return m;
    }
    return !isEmpty(domain(getTags(tags)) & {"ignore", "Ignore", "ignoreCompiler", "IgnoreCompiler"});
}

For completeness: the tags ignoreInterpreter and IgnoreInterpreter also exist but they are handled by the evaluator.

At the start of all function declaration handlers in the type checker, the following test is needed:

if(ignoreDeclaration(tags)){
   return config;
}
@PaulKlint
Copy link
Member Author

The implications of this change in behavior of the type checker were not yet propagated to the compiler: the typechecker now completely skips an ignored function while the compiler still tried to compile it (and then -- of course -- got stuck because information was missing). After adapting the compiler tests are now ignored like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants