module_compile_options.java 731 B

1234567891011121314151617181920212223242526
  1. package kawa.standard;
  2. import kawa.lang.*;
  3. import gnu.expr.*;
  4. import gnu.lists.*;
  5. public class module_compile_options extends Syntax
  6. {
  7. public static final module_compile_options module_compile_options
  8. = new module_compile_options();
  9. static { module_compile_options.setName("module-compile-options"); }
  10. @Override
  11. public boolean scanForDefinitions(Pair st, ScopeExp defs, Translator tr)
  12. {
  13. Object rest = with_compile_options.getOptions(st.getCdr(), null, this, tr);
  14. if (rest != LList.Empty)
  15. tr.error('e', getName() + " key must be a keyword");
  16. return true;
  17. }
  18. public Expression rewriteForm (Pair form, Translator tr)
  19. {
  20. return tr.syntaxError(getName()+" is only allowed in a <body>");
  21. }
  22. }