progress
This commit is contained in:
@@ -3,6 +3,7 @@ package mindustry.logic;
|
||||
import arc.struct.*;
|
||||
|
||||
public class LParser{
|
||||
Seq<LStatement> statements = new Seq<>();
|
||||
char[] chars;
|
||||
int position;
|
||||
|
||||
@@ -14,8 +15,34 @@ public class LParser{
|
||||
return new LParser(text).parse();
|
||||
}
|
||||
|
||||
void comment(){
|
||||
//read until \n or eof
|
||||
while(position < chars.length && chars[position++] != '\n');
|
||||
}
|
||||
|
||||
void statement(){
|
||||
//read jump
|
||||
if(chars[position] == '['){
|
||||
|
||||
}
|
||||
|
||||
while(position < chars.length){
|
||||
char c = chars[position ++];
|
||||
|
||||
//reached end of line, bail out.
|
||||
if(c == '\n') break;
|
||||
|
||||
if(c == '#'){
|
||||
comment();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Seq<LStatement> parse(){
|
||||
Seq<LStatement> statements = new Seq<>();
|
||||
while(position < chars.length){
|
||||
statement();
|
||||
}
|
||||
//TODO
|
||||
return statements;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user