Telecomms Refactor & CodeMirror

This commit does the following:
 - A lot of shit I am really too tired to fucking write about
 - Absolute pathed telecomms scripting
 - Browser Datum traffic control
  - Absolutely lovely replacement for the fucking skin TCS window, using
    codemirror
 - CodeMirror integration for nanoUI
  - Sorta, I didn't work on this as much as I wanted to, because IT TOOK
    11 FUCKING HOURS TO GET THE BROWSER DATUM TO WORK
This commit is contained in:
Tigercat2000
2015-10-28 17:23:22 -07:00
parent f76109ca5c
commit c244a0fe15
38 changed files with 13973 additions and 2155 deletions
+61 -71
View File
@@ -12,128 +12,118 @@
Articles:
- <http://en.wikipedia.org/wiki/Abstract_syntax_tree>
*/
var
const
/*
Constants: Operator Precedence
OOP_OR - Logical or
OOP_AND - Logical and
OOP_BIT - Bitwise operations
OOP_EQUAL - Equality checks
OOP_COMPARE - Greater than, less then, etc
OOP_COMPARE - Greater than, less then, etc
OOP_ADD - Addition and subtraction
OOP_MULTIPLY - Multiplication and division
OOP_MULTIPLY - Multiplication and division
OOP_POW - Exponents
OOP_UNARY - Unary Operators
OOP_GROUP - Parentheses
*/
OOP_OR = 1 //||
OOP_AND = OOP_OR + 1 //&&
OOP_BIT = OOP_AND + 1 //&, |
OOP_EQUAL = OOP_BIT + 1 //==, !=
OOP_COMPARE = OOP_EQUAL + 1 //>, <, >=, <=
OOP_ADD = OOP_COMPARE + 1 //+, -
OOP_MULTIPLY= OOP_ADD + 1 //*, /, %
OOP_POW = OOP_MULTIPLY+ 1 //^
OOP_UNARY = OOP_POW + 1 //!
OOP_GROUP = OOP_UNARY + 1 //()
/var/const/OOP_OR = 1 //||
/var/const/OOP_AND = OOP_OR + 1 //&&
/var/const/OOP_BIT = OOP_AND + 1 //&, |
/var/const/OOP_EQUAL = OOP_BIT + 1 //==, !=
/var/const/OOP_COMPARE = OOP_EQUAL + 1 //>, <, >=, <=
/var/const/OOP_ADD = OOP_COMPARE + 1 //+, -
/var/const/OOP_MULTIPLY= OOP_ADD + 1 //*, /, %
/var/const/OOP_POW = OOP_MULTIPLY + 1 //^
/var/const/OOP_UNARY = OOP_POW + 1 //!
/var/const/OOP_GROUP = OOP_UNARY + 1 //()
/*
Class: node
*/
/node
proc
ToString()
return "[src.type]"
/datum/node/proc/ToString()
return "[src.type]"
/*
Class: identifier
*/
/node/identifier
var
id_name
/datum/node/identifier
var/id_name
New(id)
.=..()
src.id_name=id
/datum/node/identifier/New(id)
. = ..()
src.id_name = id
ToString()
return id_name
/datum/node/identifier/ToString()
return id_name
/*
Class: expression
*/
/node/expression
/datum/node/expression
/*
Class: operator
See <Binary Operators> and <Unary Operators> for subtypes.
*/
/node/expression/operator
var
node/expression/exp
tmp
name
precedence
/datum/node/expression/operator
var/datum/node/expression/exp
var/token = "" // Used when giving type mismatches.
var/tmp/name
var/tmp/precedence
New()
.=..()
if(!src.name) src.name="[src.type]"
/datum/node/expression/operator/New()
.=..()
if(!src.name)
src.name = "[src.type]"
ToString()
return "operator: [name]"
/datum/node/expression/operator/ToString()
return "operator: [name]"
/*
Class: FunctionCall
*/
/node/expression/FunctionCall
/datum/node/expression/FunctionCall
//Function calls can also be expressions or statements.
var
func_name
node/identifier/object
list/parameters=new
var/func_name
var/datum/node/identifier/object
var/list/parameters = list()
/*
Class: literal
*/
/node/expression/value/literal
var
value
/datum/node/expression/value/literal
var/value
New(value)
.=..()
src.value=value
/datum/node/expression/value/literal/New(value)
. = ..()
src.value = value
ToString()
return src.value
/datum/node/expression/value/literal/ToString()
return src.value
/*
Class: variable
*/
/node/expression/value/variable
var
node
object //Either a node/identifier or another node/expression/value/variable which points to the object
node/identifier
id
/datum/node/expression/value/variable
var/datum/node/object //Either a node/identifier or another node/expression/value/variable which points to the object
var/datum/node/identifier/id
New(ident)
.=..()
id=ident
if(istext(id))id=new(id)
/datum/node/expression/value/variable/New(ident)
. = ..()
id = ident
if(istext(id))
id = new(id)
ToString()
return src.id.ToString()
/datum/node/expression/value/variable/ToString()
return src.id.ToString()
/*
Class: reference
*/
/node/expression/value/reference
var
datum/value
/datum/node/expression/value/reference
var/datum/value
New(value)
.=..()
src.value=value
/datum/node/expression/value/reference/New(value)
. = ..()
src.value = value
ToString()
return "ref: [src.value] ([src.value.type])"
/datum/node/expression/value/reference/ToString()
return "ref: [src.value] ([src.value.type])"