1 %module ruby_keywords 2 3 // fix up conflicts with C++ keywords 4 %rename("and") Keywords::and_; 5 %rename("break") Keywords::break_; 6 %rename("case") Keywords::case_; 7 %rename("class") Keywords::class_; 8 %rename("defined?") Keywords::defined_; 9 %rename("do") Keywords::do_; 10 %rename("else") Keywords::else_; 11 %rename("false") Keywords::false_; 12 %rename("for") Keywords::for_; 13 %rename("if") Keywords::if_; 14 %rename("not") Keywords::not_; 15 %rename("return") Keywords::return_; 16 %rename("or") Keywords::or_; 17 %rename("true") Keywords::true_; 18 %rename("while") Keywords::while_; 19 20 21 %inline %{ 22 23 class Keywords { 24 public: Keywords()25 Keywords() {} 26 alias()27 const char* alias() { return "alias"; } and_()28 const char* and_() { return "and"; } begin()29 const char* begin() { return "begin"; } break_()30 const char* break_() { return "break"; } case_()31 const char* case_() { return "case"; } class_()32 const char* class_() { return "class"; } def()33 const char* def() { return "def"; } defined_()34 const char* defined_() { return "defined?"; } do_()35 const char* do_() { return "do"; } else_()36 const char* else_() { return "else"; } elsif()37 const char* elsif() { return "elsif"; } end()38 const char* end() { return "end"; } ensure()39 const char* ensure() { return "ensure"; } false_()40 const char* false_() { return "false"; } for_()41 const char* for_() { return "for"; } if_()42 const char* if_() { return "if"; } in()43 const char* in() { return "in"; } module()44 const char* module() { return "module"; } next()45 const char* next() { return "next"; } nil()46 const char* nil() { return "nil"; } not_()47 const char* not_() { return "not"; } or_()48 const char* or_() { return "or"; } redo()49 const char* redo() { return "redo"; } rescue()50 const char* rescue() { return "rescue"; } retry()51 const char* retry() { return "retry"; } return_()52 const char* return_() { return "return"; } self()53 const char* self() { return "self"; } super()54 const char* super() { return "super"; } then()55 const char* then() { return "then"; } true_()56 const char* true_() { return "true"; } undef()57 const char* undef() { return "undef"; } under()58 const char* under() { return "under"; } unless()59 const char* unless() { return "unless"; } until()60 const char* until() { return "until"; } when()61 const char* when() { return "when"; } while_()62 const char* while_() { return "while"; } yield()63 const char* yield() { return "yield"; } 64 }; 65 %} 66