Skip to content

Commit e1ec47d

Browse files
committed
Replace snake case with camelCasing.
1 parent a7753bc commit e1ec47d

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed

src/META-INF/MANIFEST.MF

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Main-Class: org.luapp.language.Main

src/main/java/org/luapp/language/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/main/java/org/luapp/language/handlers/ClassBodyHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

src/main/java/org/luapp/language/handlers/ClassFunctionHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/main/java/org/luapp/language/handlers/ClassGetSetHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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\treturn self." + nameText + "\nend" );
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\tself." + nameText + " = obj\nend" );
4142
}
4243
}

src/main/java/org/luapp/language/handlers/SafeHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

src/main/java/org/luapp/language/test.lpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
class cat extends animal
22

33
name {get set}
4+
age {get set}
5+
type {get }
46

57
constructor(name)
68
self.name = name

0 commit comments

Comments
 (0)