优化输入逻辑
This commit is contained in:
parent
d3494091a0
commit
dbdb906a49
16
.run/Main.run.xml
Normal file
16
.run/Main.run.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Main" type="Application" factoryName="Application" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="org.jcnc.snow.compiler.Main" />
|
||||
<module name="SCompiler" />
|
||||
<option name="PROGRAM_PARAMETERS" value="test" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="org.jcnc.snow.compiler.parser.preprocessor.lexer.impl.api.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
@ -17,8 +17,8 @@ import java.util.List;
|
||||
public class Main {
|
||||
public static void main(String[] args) throws IOException {
|
||||
// 读取源文件
|
||||
String filePath = args.length > 0 ? args[0] : "test";
|
||||
String source = Files.readString(Path.of(filePath), StandardCharsets.UTF_8);
|
||||
String source = Files.readString(Path.of(args[0]), StandardCharsets.UTF_8);
|
||||
|
||||
|
||||
// 1. 词法分析
|
||||
LexerEngine lexerEngine = new LexerEngine(source);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user