feat: 语义错误定位为绝对路径

This commit is contained in:
Luke 2025-06-09 14:55:24 +08:00
parent f356bcf227
commit 8d628d29d2

View File

@ -1,6 +1,8 @@
package org.jcnc.snow.compiler.parser.context;
import org.jcnc.snow.compiler.lexer.token.Token;
import java.nio.file.Paths;
import java.util.List;
/**
@ -33,7 +35,7 @@ public class ParserContext {
*/
public ParserContext(List<Token> tokens, String sourceName) {
this.tokens = new TokenStream(tokens);
this.sourceName = sourceName;
this.sourceName = Paths.get(sourceName).toAbsolutePath().toString();
}