From 7ff7f7c117a5cc8e1703b6c5f8fc81bb40f717a8 Mon Sep 17 00:00:00 2001 From: kjw142857 Date: Fri, 6 Nov 2026 01:53:27 +0800 Subject: [PATCH 1/4] Update READMEs --- README.md | 59 +++++++++++++++++++++++------------------- src/compiler/README.md | 21 ++++++++++----- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index e7d7f7f..3a97207 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Open-source Implementation of the Java language in TypeScript. ( Pages in the forked repo and choose to deploy using Github Actions. -Then, from your local copy of frontend: +3. After the initial build is finished (should take a few minutes), check that the repo has been deployed at "{Github Page URL of forked java-slang repo}/index.js". You can find the Github Page URL by clicking on Deployments/github-pages on the right sidebar of the forked repo. Note that you must add "/index.js" to the end when checking at the URL, and it should not display a 404 error there but rather a text dump. -```bash -$ cd frontend -$ yarn link path/to/java-slang -``` +3. Next, fork the [language-directory](https://github.com/source-academy/language-directory) repo and all its branches to your own repository. Similarly choose to deploy using Github Actions. + +4. In the src/languages/java/index.ts file of the forked language-directory repo, replace the javaDefault path with the GH Pages URL of your deployed java-slang repo (including the index.js part). + +5. Check that the language directory repo has been deployed on Github Pages at "{Github Page URL of forked language-directory repo}/directory.json" by visiting it. You should see a JSON dump instead of a 404 error. + +6. In the frontend, go to Settings -> Feature Flags and change the language directory URL to the one in step 5. Do not click the reload button next to the flag, that resets it to the [default language directory](https://source-academy.github.io/language-directory/directory.json). + +7. To test local changes, simply push them to your forked java-slang repo and the changes will automatically show up in the frontend within a few minutes (recommended to refresh the page before attempting to test them). -Replace "path/to/java-slang" with the path to the java-slang repository. After running the command, start the frontend and the new java-slang will be used. +8. If you are utilising a branch other than main in your forked java-slang repo, do note that you will need to add the name of the branch in the build-deploy file in .github/workflows in order for the changes to be reflected in your Conductor build. You only need to do this inside the branch itself, once per branch creation (so that future builds in that branch will recognise that its code should be used). ## License diff --git a/src/compiler/README.md b/src/compiler/README.md index 7fa0faa..63bc30e 100644 --- a/src/compiler/README.md +++ b/src/compiler/README.md @@ -2,23 +2,28 @@ This is a bookkeeping of the planned scope of the compiler. It will be updated f **Features that are already supported** -- Single source file, single public class, with exactly one main method -- Methods that have `public static` access flags, return `int/void`, never throw exception -- `int` variables -- `int/boolean/String` literals +- Single source file, multiple classes, with exactly one class named "Main" with a main method +- Methods that have `public static` access flags +- Any primitive type and String variables - Controls (`if-else`, `while`, `do-while`, basic `for` loop, `break`, `continue`, `return` statements), loops and if-elses can be nested in each other - Arithmetic and conditional expressions - Assignment statements - Method invocation - Non-static import statements - Single dimension array declaration/initialization -- Primitive type variables - Class fields (with `public static` access flag) - Object instantiation (with `new` keyword) - Instance fields/methods - Class inheritance - Method overloading/overriding -- Type casting +- Type casting (both implicit and explicit) +- Abstract classes +- Exception handling (`throws`, `try`, `catch` and `finally`) +- Many standard library classes and methods (in import/generated-lib-info.json) +- Switch statements +- Enums +- Static inner classes + **Features that can possibly be supported in the future** @@ -27,7 +32,9 @@ This is a bookkeeping of the planned scope of the compiler. It will be updated f - Multiple files, modules, packages - Interfaces - Generics -- Exceptions +- Newer keywords, e.g. `yield` +- Explicit constructors +- Multi-dimensional arrays & array instantiation using `new` keyword **Testing** From 2848ef531c30df217c08c6af7722f78991ae2375 Mon Sep 17 00:00:00 2001 From: kjw142857 <122250318+kjw142857@users.noreply.github.com> Date: Wed, 11 Nov 2026 23:53:00 +0800 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a97207..2d53331 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ The Java language in Source Academy is based on the [Java 8 SE](https://docs.ora - Generics - Multi-file programs - Interfaces -- Explicit constructor invocation (i.e. defining custom constructors) +- Explicit constructor invocation using super(...) and this(...) - Possible upgrading to follow newer versions of Java, e.g. 15 ## Testing From de98dd840b1f43e693ff17e3c38df12c58a6b981 Mon Sep 17 00:00:00 2001 From: kjw142857 <122250318+kjw142857@users.noreply.github.com> Date: Wed, 11 Nov 2026 23:54:14 +0800 Subject: [PATCH 3/4] Update README.md --- src/compiler/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/README.md b/src/compiler/README.md index 63bc30e..0cab925 100644 --- a/src/compiler/README.md +++ b/src/compiler/README.md @@ -22,7 +22,7 @@ This is a bookkeeping of the planned scope of the compiler. It will be updated f - Many standard library classes and methods (in import/generated-lib-info.json) - Switch statements - Enums -- Static inner classes +- Static nested classes @@ -33,12 +33,12 @@ This is a bookkeeping of the planned scope of the compiler. It will be updated f - Interfaces - Generics - Newer keywords, e.g. `yield` -- Explicit constructors -- Multi-dimensional arrays & array instantiation using `new` keyword +- Explicit constructor invocation (`super(...)` and `this(...)`) +- Multi-dimensional arrays **Testing** Unit tests are located in the "__tests__/tests" folder. The main testing file is "__tests__/index.ts", in which the tests to be run can be specified. To run, navigate to the main java-slang folder and run: ```bash $ yarn test src/compiler/__tests__/index.ts -``` \ No newline at end of file +``` From c81142a851ec17925c3a14f71bdb214f04f3c623 Mon Sep 17 00:00:00 2001 From: kjw142857 <122250318+kjw142857@users.noreply.github.com> Date: Wed, 11 Nov 2026 23:55:15 +0800 Subject: [PATCH 4/4] Add code formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d53331..db6d9a2 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ The Java language in Source Academy is based on the [Java 8 SE](https://docs.ora - Implicit type widening - Explicit type conversion - Basic exception/error messages -- Many standard libraries including system calls e.g. System.out.println +- Many standard libraries including system calls e.g. `System.out.println` - Static nested classes - Switch statements - Multiple classes in one file @@ -64,7 +64,7 @@ The Java language in Source Academy is based on the [Java 8 SE](https://docs.ora - Generics - Multi-file programs - Interfaces -- Explicit constructor invocation using super(...) and this(...) +- Explicit constructor invocation using `super(...)` and `this(...)` - Possible upgrading to follow newer versions of Java, e.g. 15 ## Testing