Giter Club home page Giter Club logo

asl's Introduction

Hi, my name is Marvin!

I'm a full-stack software engineer from Germany, open-source and Linux enthusiast, and co-founder of Emvi, where we build and maintain software projects for clients, and work on existing software.

Iโ€™m building Pirsch Analytics โ€” a privacy-friendly, cookie-less web analytics solution made for personal websites, freelancers, and agencies. For more about myself, check out my website.

asl's People

Contributors

654wak654 avatar kugelschieber avatar nikolauska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

asl's Issues

code() does not remove string masks

addEventHandler(_c)("CuratorGroupPlaced", code("spawn(_this, \"ZeusGrpPlaced\")(BIS_fnc_MP);"));

will be:

_c addEventHandler ["CuratorGroupPlaced", {[_this, \"ZeusGrpPlaced\"] spawn BIS_fnc_MP;}];

Backslashes are required, but must be removed when code is inserted!

Splitting project for go get usage

It would be good to split project into individual parts that you can use go get command to fetch code and make it possible to have multiple go projects in same place.

This would of course require to create organization for this project
Example usage:

go get github.com/arma-scripting-language/tokenizer
go get github.com/arma-scripting-language/parser
go get github.com/arma-scripting-language/asl

Cleanup

Remove .project, ToDo.md. Add run scripts.

null

Add something like null for objNull, ...

Not working on Windows!

Characters don't seem to be read correctly.
Example:

var x = 1;
var y = 2;

Results in:

x = 1;
vary = 2;

Feature request: function library compability

Looks nice and handy! Unfortunately I am using the function framework since A3 and it doesn't look like your compiler supports this at the moment. Maybe you should consider compiling your functions into fn_functionname.sqf files and automatically register them in description.ext or config.
This way you could even make c-like entry point functions (int main()) using preinit/postinit.
Do you plan to emulate classes in the future?

by NeoArmageddon
see: https://forums.bistudio.com/topic/185649-asl-arma-scripting-language-compiler/

Better error output

Add line number and column to the error output.
Do not panic on parse errors!

New line after while loop with pretty printing

I don't think pretty printing adds a new line after a while loop's closing bracket. I know pretty printing isn't that pretty to begin with, but it's just something I noticed.

Example:

func bsFunction(_a, _b) {
return _a+_b;
while (_i < []) {
hint("s");
}
alive(this_is_meanless_code);

}

compiles into

bsFunction = {
params ["_a","_b"];
return _a+_b;
while {(_i<[])} do {
hint "s";
};alive this_is_meanless_code; <--Notice?

};

Fix test

Tests are broken, but code output seems ok.

Inline code

Inlining code is not possible, example:

_x addEventHandler ["CuratorGroupPlaced", {[_this, "ZeusGrpPlaced"] spawn BIS_fnc_MP}];

Need a solution for this.

Better foreach

Move to

foreach unit in allUnits {
}

Disallow usage of "_x" as element variable.

Test unary function fix

Build in unary functions were compiled with a "call".
Test the new implementation. It didn't worked espacially for the "format" function.

Files With the Same Name Aren't Compiled

If a file has the same name with a file in the most upper folder, it isn't compiled. The processes still creates an empty folder though.

Made some tests, imagine Input dir parameter is "D:\Folder". If the scripts are like the following:

"D:\Folder\test_script.asl"
"D:\Folder\new_folder\test_script.asl"

Only the script in the upper folder will be compiled, but en empty new_folder will still be created. The following examples both work, so it has to do with the script in the first folder:

"D:\Folder\new_folder_0\test_script.asl"
"D:\Folder\new_folder_1\test_script.asl"
"D:\Folder\new_folder\test_script.asl"
"D:\Folder\new_folder\newer_folder\test_script.asl"

Parse code to a "package" in a C-like way with standard-functions

This is a rather broad idea and would involve not only changes in the parser/compiler but also some helper librarys in sqf. My idea is to expand your project not only to compile ASL to SQF files, but build a set of multiple ASL files to a complete sqf "program" in ArmA3.
Here is a basic sketch of the idea:

  • ASL files are preprocessed
  • global functions (maybe classes later) are compiled to their opwn function library files and registred in a functions.hpp.
  • a "main" function is declared with "postinit = 1" to autostart when mission runs (functions could also be tied to triggers, plain scripts, etc in arma).
  • Some helper functions (like the C-STL) are also compiled/precompiled to the output.

With the last you or somebody else could add new virtual types to ArmA3 as special sqf functions get automatically added to the A3 mission/addon and the corresponding functions can be used in ASL.

For example a new type Vector2 (ArmA3 only supports 3D vector commands until now):
Internally Vector2(x,y) is translated to [x,y]. But when something like
Vector2 _blah = Vector2(1,2) + Vector2(4,5); is written in ASL it gets compiled to
_blah = [[1,2],[4,5]] call ASL_fnc_Vector2_Add;
//_blah = [5,7];

From here it should be easier to take this idea even further ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.