Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make jlox support relative paths #16

Open
zxul767 opened this issue Nov 11, 2022 · 1 comment
Open

make jlox support relative paths #16

zxul767 opened this issue Nov 11, 2022 · 1 comment
Labels
enhancement New feature or request p1

Comments

@zxul767
Copy link
Owner

zxul767 commented Nov 11, 2022

clox currently supports relative paths when running files as follows:

make run NAME=../samples/basic_class.lox

we should make jlox support the same. at present it throws this error:

Exception in thread "main" java.nio.file.NoSuchFileException: ../samples/basic_class.lox
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
        at java.base/java.nio.file.Files.newByteChannel(Files.java:375)
        at java.base/java.nio.file.Files.newByteChannel(Files.java:426)
        at java.base/java.nio.file.Files.readAllBytes(Files.java:3272)
        at dev.zxul767.lox.Lox.runFile(Lox.java:49)
        at dev.zxul767.lox.Lox.main(Lox.java:42)
@zxul767 zxul767 added the enhancement New feature or request label Nov 11, 2022
@zxul767 zxul767 added p1 p0 and removed p1 labels Dec 7, 2022
@zxul767
Copy link
Owner Author

zxul767 commented Dec 7, 2022

marking as p1 because the workaround, although easy, is not intuitive:

make run NAME=$PWD/../samples/string.lox

@zxul767 zxul767 added p1 and removed p0 labels Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p1
Projects
None yet
Development

No branches or pull requests

1 participant