- Joined
- Nov 7, 2014
- Messages
- 571
Repl - a REPL written in vJass
Update: 2017.09.09
- now uses the Memory library's 'module Bytecode' to execute bytecode
- no longer requires //! inject config (fix by leandrotp)
Code:
1. Required tools
1.1 jasshelper (vJass)
1.2 LeP's updated pjass for the "//# +nosemanticerror" annotations: https://www.hiveworkshop.com/threads/pjass-updates.258738/
2. Required external libraries
1.1 leandrotp's Typecast and Memory libraries: https://www.hiveworkshop.com/threads/accessing-memory-from-the-script-its-time-of-the-revolution.279262/
1.2 Lord of theDing's StringFromId: https://www.hiveworkshop.com/threads/jasm-lets-dive-into-bytecode.293369/
1.3 LeP's Jass parsing library: https://www.hiveworkshop.com/threads/jass%C2%B2-a-jass-parser-written-in-vjass.294283/
3. Configuration
Repl comes with the common-j-native-wrappers.j and common-ai-native-wrappers.j that
wrap all the natives in jass functions which helps with type checking.
The natives are divided into groups, only native functions from a group that is enabled
can be called from the REPL.
4. Supported statements/commands
4.1 Global variable declaration
syntax: global <type> <variable-name> [= <expr>]
<type> can be any of:
code, integer, real, string, handle, boolean,
integer array, real array, string array, handle array, boolean array
examples:
global integer foo
global integer bar = 1
global string array bazs
global handle hero = CreateUnit(Player(0), 'Hpal', 0.0, 0.0, 270.0)
4.2 Variable assignment
syntax: set <var> = <expr>
examples:
set foo = 2
set bazs[bar] = "baz1"
set foo = IntegerTertiaryOp(foo > 1 and not false, 1 + 2 - 3, 4 * 5 / 6)
4.3 Function call in void context
syntax: call <function-name>([args])
examples:
call BJDebugMsg(bazs[bar])
4.4 Printing variable/function information
syntax: x <name>
examples:
x foo
x bazs
x BJDebugMsg
Update: 2017.09.09
- now uses the Memory library's 'module Bytecode' to execute bytecode
- no longer requires //! inject config (fix by leandrotp)
Attachments
Last edited: