示例#1
0
 public void Scenario_RubyNameMangling2()
 {
     Assert(RubyUtils.MangleName("IPStack") == "ip_stack"); // TODO
     Assert(RubyUtils.MangleName("Stack") == "stack");
     Assert(RubyUtils.MangleName("ThisIsMyLongName") == "this_is_my_long_name");
     Assert(RubyUtils.MangleName("") == "");
     Assert(RubyUtils.MangleName("F") == "f");
     Assert(RubyUtils.MangleName("FO") == "fo");
     Assert(RubyUtils.MangleName("FOO") == "foo");
     Assert(RubyUtils.MangleName("FOOBar") == "foo_bar");
     Assert(RubyUtils.MangleName("MaM") == "ma_m");
     Assert(RubyUtils.MangleName("initialize") == "initialize");
     Assert(RubyUtils.MangleName("Initialize") == "Initialize");
 }
示例#2
0
 protected override bool TryGetName(Type clrType, PropertyInfo pi, MethodInfo mi, out string name)
 {
     if (mi.Name.StartsWith("get_"))
     {
         name = RubyUtils.MangleName(pi.Name);
     }
     else if (mi.Name.StartsWith("set_"))
     {
         name = RubyUtils.MangleName(pi.Name) + "=";
     }
     else
     {
         name = null;
         return(false);
     }
     return(true);
 }
示例#3
0
 protected override bool TryGetName(Type clrType, EventInfo ei, MethodInfo mi, out string name)
 {
     // TODO: Determine naming convention?
     name = RubyUtils.MangleName(ei.Name);
     return(true);
 }
示例#4
0
 protected override bool TryGetName(Type clrType, MethodInfo mi, out string name)
 {
     name = RubyUtils.MangleName(mi.Name);
     return(true);
 }