mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-23 21:19:39 +07:00
Support inline comments (#4196)
* Support inline comments Closes https://github.com/Anuken/Mindustry-Suggestions/issues/1698. * Apply suggestions from code review Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com> * Stick with Mindustry formatting style Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>
This commit is contained in:
parent
ab19e6ffbd
commit
044fb30b1b
@ -62,7 +62,9 @@ public class LAssembler{
|
||||
int index = 0;
|
||||
for(String line : lines){
|
||||
//comments
|
||||
if(line.startsWith("#") || line.isEmpty()) continue;
|
||||
int commentIdx = line.indexOf('#');
|
||||
if(commentIdx != -1) line = line.substring(0, commentIdx).trim();
|
||||
if(line.isEmpty()) continue;
|
||||
//remove trailing semicolons in case someone adds them in for no reason
|
||||
if(line.endsWith(";")) line = line.substring(0, line.length() - 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user