File tree Expand file tree Collapse file tree 7 files changed +8
-7
lines changed
main/java/org/luapp/language Expand file tree Collapse file tree 7 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1+ Main-Class : org.luapp.language.Main
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ public class Main {
88
99 public static Luapp luaPPInstance ;
1010
11+ public static String output = "" ;
1112
1213 public static void main (String [] args ){
13- String path = args [0 ];//System.getProperty("user.dir") + "/src/main/java/org/luapp/language/test.lpp";
14+ String path = args [0 ];
1415 Main .luaPPInstance = new Luapp (path );
1516 Main .luaPPInstance .load ();
1617 }
Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ public void onSetManager() {
3434
3535 @ Override
3636 public void onEnterContext (ParserRuleContext enterContext ) {
37- System .out .println ("Being called?" + enterContext .getRuleIndex ());
38-
3937 if (this .getLuaPP ().currentClass .isEmpty ()) {
4038 System .out .println ("No class name, not completing body." );
4139 return ;
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ public void onSetManager() {
2020 public void onEnterContext (ParserRuleContext enterContext ) {
2121 ParseTree name = enterContext .getChild (1 );
2222 ParseTree body = enterContext .getChild (2 );
23- System .out .println (name );
2423 this .addToLuaPPResult ("function " + this .getLuaPP ().currentClass
2524 + ":" + name .getText () + this .getLuaPP ().getRawFromContext ((ParserRuleContext )body ));
2625 }
Original file line number Diff line number Diff line change @@ -32,11 +32,12 @@ public void onEnterContext(ParserRuleContext enterContext) {
3232 if (getset instanceof TerminalNodeImpl ) continue ;
3333 if (((ParserRuleContext )getset ).getRuleIndex () == luappParser .RULE_classgetorset ){
3434 String getSet = getset .getText ();
35+ String camelCaseName = nameText .substring (0 , 1 ).toUpperCase () + nameText .substring (1 );
3536 if (getSet .equals ("get" )){
36- this .addToLuaPPResult ("function " + this .getLuaPP ().currentClass + ":get_ " + nameText + "()" +
37+ this .addToLuaPPResult ("function " + this .getLuaPP ().currentClass + ":get " + camelCaseName + "()" +
3738 "\n \t return self." + nameText + "\n end" );
3839 }else if (getSet .equals ("set" )){
39- this .addToLuaPPResult ("function " + this .getLuaPP ().currentClass + ":set_ " + nameText + "(obj)" +
40+ this .addToLuaPPResult ("function " + this .getLuaPP ().currentClass + ":set " + camelCaseName + "(obj)" +
4041 "\n \t self." + nameText + " = obj\n end" );
4142 }
4243 }
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ public void onSetManager() {
2121 @ Override
2222 public void onEnterContext (ParserRuleContext enterContext ) {
2323 //luappParser.SafeOperatorContext safeOperatorContext = (luappParser.SafeOperatorContext)enterContext;
24- System .out .println ("here?" );
2524 StringBuilder stat = new StringBuilder ("if " );
2625 String name = "" ;
2726 boolean first = false ;
Original file line number Diff line number Diff line change 11class cat extends animal
22
33 name {get set}
4+ age {get set}
5+ type {get }
46
57 constructor(name)
68 self.name = name
You can’t perform that action at this time.
0 commit comments