Restructure project to make room for clox
This commit is contained in:
parent
62bd0f83dc
commit
68a2ebd34f
31 changed files with 27 additions and 7 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
jlox.sum
|
||||
jlox.log
|
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
|
@ -10,10 +10,10 @@ pipeline {
|
|||
steps {
|
||||
cmakeBuild installation: 'InSearchPath',
|
||||
buildDir: 'build',
|
||||
sourceDir: 'src',
|
||||
sourceDir: 'jlox',
|
||||
steps: [[args: 'all']]
|
||||
|
||||
archiveArtifacts artifacts: 'build/com/craftinginterpreters/lox/Lox.jar',
|
||||
archiveArtifacts artifacts: 'jlox/_build/com/craftinginterpreters/lox/Lox.jar',
|
||||
fingerprint: false,
|
||||
onlyIfSuccessful: true
|
||||
}
|
||||
|
|
3
jlox
3
jlox
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
/usr/bin/java -jar src/_build/com/craftinginterpreters/lox/Lox.jar "$@"
|
0
src/.gitignore → jlox/.gitignore
vendored
0
src/.gitignore → jlox/.gitignore
vendored
|
@ -5,4 +5,4 @@ include(UseJava)
|
|||
|
||||
project(Lox NONE)
|
||||
|
||||
add_subdirectory(com/craftinginterpreters)
|
||||
add_subdirectory(src/com/craftinginterpreters)
|
3
jlox/jlox
Executable file
3
jlox/jlox
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
java -jar "$(dirname "$0")/_build/src/com/craftinginterpreters/lox/Lox.jar" "$@"
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.formatter.lineSplit=80
|
9
src/fib.lox
Normal file
9
src/fib.lox
Normal file
|
@ -0,0 +1,9 @@
|
|||
fun fib(n) {
|
||||
if (n < 2) return n;
|
||||
return fib(n - 1) + fib(n - 2);
|
||||
}
|
||||
|
||||
var before = clock();
|
||||
print fib(40);
|
||||
var after = clock();
|
||||
print after - before;
|
7
src/test.lox
Normal file
7
src/test.lox
Normal file
|
@ -0,0 +1,7 @@
|
|||
class Bacon {
|
||||
eat() {
|
||||
print "Crunch crunch crunch!";
|
||||
}
|
||||
}
|
||||
|
||||
Bacon().eat();
|
|
@ -1,5 +1,5 @@
|
|||
set test_name "Printing"
|
||||
set command_line "./jlox"
|
||||
set command_line "jlox/jlox"
|
||||
|
||||
spawn $command_line
|
||||
send "print \"Hello, world!\";\n"
|
||||
|
|
Loading…
Reference in a new issue