mani-language / Mani

Máni ... an awesome, super simple programming language!
https://mani-language.github.io/
Mozilla Public License 2.0
28 stars 7 forks source link

Compiler #64

Closed Kalekdan closed 5 years ago

Kalekdan commented 5 years ago

Name: Compiler About: Mani can now "compile" code into a runnable jar

Is your PR related to a feature request or Bug report? If applicable, please list feature request number or bug report ID.

44

Describe your PR A clear and concise description of what your pull request is changing or adding.

Added a new module to build a jar including mani code which can then be run in isolation and will run the code.

Describe intended use A clear and concise description of the intended use of the feature. Along with example code.

Mani files are put in the resources folder, with a single main.mni file. Then building will generate the jar

Additional comments Add any additional comments or screenshots here.

I am not particularly familiar with gradle so the current implementation replaces the existing build task. I would need some guidance in how to create a second separate task to build just the compiler jar

Kalekdan commented 5 years ago

This is complete apart from gradle task. Need to create a separate task that does not affect the main build task. Compilation task must:

crazywolf132 commented 5 years ago

@Kalekdan Good work. It should be able to go into the same build file. Take a look at how the gradle idea task works

Kalekdan commented 5 years ago

This is working now. Mani can be compiled with gradle buildCompiler. Any .mni scripts in the resources directory will be included into a jar which can be run independently and will run the Máni code. I'm not sure what the line with jar on line 45 does but I found some examples online and it seems to work for this. If you can enlighten me then please do 😂

crazywolf132 commented 5 years ago

@Kalekdan please update the branch to follow the new structure if possible.

65 implemented a new file structure

Kalekdan commented 5 years ago

@crazywolf132 I've updated so that the code for compiler is now at src/com/mani/compiler/ManiCompiler.java. Is this appropriate or should it be more like src/com/mani/lang/compiler/ManiCompiler.java

crazywolf132 commented 5 years ago

First option sounds fine

crazywolf132 commented 5 years ago

Are we ready to merge?

Kalekdan commented 5 years ago

Are we ready to merge?

Yes

crazywolf132 commented 5 years ago

Well done!