decaf-lang / decaf Goto Github PK
View Code? Open in Web Editor NEWThe new Decaf compiler, rewritten in "modern" Java
The new Decaf compiler, rewritten in "modern" Java
I'm on Linux Manjaro and I was trying to build decaf from the src and when I would run: gradle build
it would fail for the jar task stating something about a duplicate META-INF/LICENSE file. The fix for me was this:
The original snippet of the build.gradle file:
`tasks.compileJava.dependsOn tasks.ll1pg
jar {
manifest {
attributes 'Main-Class': 'decaf.Main'
}
// Create a fat JAR with all the dependencies.
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}`
I changed it to:
`tasks.compileJava.dependsOn tasks.ll1pg
jar {
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE);
manifest {
attributes 'Main-Class': 'decaf.Main'
}
// Create a fat JAR with all the dependencies.
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}`
and now, despite giving an error about JavaExecHandlerBuilder.setMain(String) method being deprecated, it compiles. I also changed the commons-cli version from 1.5 to 1.5.0 though I'm not sure if that matters.
Input:
class Main {
static void main() {
int[][] test;
int[] a = new int[test[10]];
int[] b = new int[main()];
main()[10] = 1;
}
}
Output:
*** Error at (4,31): new array length must be an integer
*** Error at (5,31): new array length must be an integer
*** Error at (6,13): [] can only be applied to arrays
Should be:
*** Error at (4,27): new array length must be an integer
*** Error at (5,27): new array length must be an integer
*** Error at (6,15): [] can only be applied to arrays
Some students say they cannot build the project with gradlew
. @Harry-Chen suspects the gradle jar is missing (ignored by .gitignore
) and maybe it's true. However, I believe *.jar
files should be ignored because we hope students NOT submit their built jars to their repositories.
Currently, please install the lastest gradle yourself and use gradle build
instead.
This bug is considered in the next release.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.