mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
▫ Signals can now be rejected by Subspace broadcasters through a specific data[] parameter. ▫ Improved the log browser. ▫ Log browsers and telecommunication monitors no longer require access to use. You do need access to delete logs, however. ▫ Intercoms need power to work. They don't drain power, they just need a constant flow of equipment power. As such, that offline intercom sprite's now finally being put to use. Scripting language: ▫ Sorry about all the files; they're all necessary! It's important to notice that the basic structure of the scripting language code is not mine; I cannibalized the base structure from some obscure BYOND project. It's pretty well documented, and I'd say easier to browse through than atmos. Here's the basic deal: A compiler datum manages the relationships between the three main subsystems of a scripting language: the Scanner, the Parser, and the Interpreter. The Scanner splits raw text into token datums that the Parser can read. The Parser transforms the otherwise random bits and strings into ordered AST Trees and nodes for the Interpreter to read. The interpreter actually executes the code and handles scope/functions/code blocks. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3193 316c924e-a436-60f5-8080-3fe189b3f50e
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
/*
|
|
File: Block Types
|
|
*/
|
|
/*
|
|
Class: BlockDefinition
|
|
An object representing a set of actions to perform independently from the rest of the script. Blocks are basically just
|
|
lists of statements to execute which also contain some local variables and methods. Note that since functions are local to a block,
|
|
it is possible to have a function definition inside of any type of block (such as in an if statement or another function),
|
|
and not just in the global scope as in many languages.
|
|
*/
|
|
/node/BlockDefinition
|
|
var/list
|
|
statements = new
|
|
functions = new
|
|
initial_variables = new
|
|
|
|
proc
|
|
/*
|
|
Proc: SetVar
|
|
Defines a permanent variable. The variable will not be deleted when it goes out of scope.
|
|
|
|
Notes:
|
|
Since all pre-existing temporary variables are deleted, it is not generally desirable to use this proc after the interpreter has been instantiated.
|
|
Instead, use <n_Interpreter.SetVar()>.
|
|
|
|
See Also:
|
|
- <n_Interpreter.SetVar()>
|
|
*/
|
|
SetVar(name, value)
|
|
initial_variables[name]=value
|
|
|
|
|
|
/*
|
|
Class: GlobalBlock
|
|
A block object representing the global scope.
|
|
*/
|
|
//
|
|
GlobalBlock
|
|
New()
|
|
initial_variables["null"]=null
|
|
return ..()
|
|
|
|
/*
|
|
Class: FunctionBlock
|
|
A block representing a function body.
|
|
*/
|
|
//
|
|
FunctionBlock |