jpaffrath / jask Goto Github PK
View Code? Open in Web Editor NEWInterpreter for the jask-language
License: GNU General Public License v3.0
Interpreter for the jask-language
License: GNU General Public License v3.0
function get(a:b) return a end
// will not work because parameter are splitted at ':' char
print(get("foo":"bar"))
"Error: variable 'get("foo"' not defined in this context!"
myFunction(2 times 2)
If one tries to call a function that imports a module a second time,
the module is still loaded in the function context.
Two ways to solve that:
function pr(a:b:c)
printLine(a)
printLine(b)
printLine(c)
end
store "Number : one" in var
pr(var:"Test":"front back")
if CONDITION doSomething else endif
should be
if CONDITION doSomething endif
Example:
File a.jask: File b.jask:
use b.jsak use a.jask
A colon separates two parameters. If a colon is placed in a string, jask will interpret it as a parameter separation.
function test(str)
printLine(str)
end
test("A:Text")
Functions as parameters would be a nice feature
The following will not fail:
assign "Test" to struct-str
store "Outside" in str
function test()
printLine(!str)
end
test() ; works
test() ; fails
function test(a) return a plus 2 end
This failes
store 100 in num function test() print(num) end
because before executing functions, a new local heap for the parameters is created.
This function heap does not containt the variables outside.
call myFunc() 20 times
If one creates a function, an if statement or a run statement in just one line, the interactive mode still waits for the "end" token
store list(1:2:3) in myList
function def(param)
printLine(param)
end
def(myList)
list(list(1):list(2))
In interactive mode, invoking this:
functions
will be treat as a function definition.
will fail:
isString(NULL)
null-checks in InternalFunctions.java are unnecessary, because the Executer.java creates the FunctionHeap with new initialized variables for every function call.
assign "Test" times 2
will produce TestTest
printLine("This is" : "not working")
If a module is imported
use testmodule
the program can access all defined variables from testmodule
run i to getSize() with i plus 1
will fail
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.