mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
/datum/stack replaces /stack, naming scheme redo for procs and linked_element --> linked_node
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
A basic description as to what went wrong.
|
||||
*/
|
||||
message
|
||||
stack/stack
|
||||
datum/stack/stack
|
||||
|
||||
proc
|
||||
/*
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
node
|
||||
BlockDefinition/program
|
||||
statement/FunctionDefinition/curFunction
|
||||
stack
|
||||
datum/stack
|
||||
scopes = new()
|
||||
functions = new()
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
var
|
||||
token/accessor/A=T
|
||||
node/expression/value/variable/E//=new(A.member)
|
||||
stack/S=new()
|
||||
datum/stack/S = new()
|
||||
while(istype(A.object, /token/accessor))
|
||||
S.Push(A)
|
||||
A=A.object
|
||||
@@ -130,7 +130,7 @@
|
||||
Takes the operator on top of the opr stack and assigns its operand(s). Then this proc pushes the value of that operation to the top
|
||||
of the val stack.
|
||||
*/
|
||||
Reduce(stack/opr, stack/val)
|
||||
Reduce(datum/stack/opr, datum/stack/val)
|
||||
var/node/expression/operator/O=opr.Pop()
|
||||
if(!O) return
|
||||
if(!istype(O))
|
||||
@@ -181,7 +181,7 @@
|
||||
- <ParseParamExpression()>
|
||||
*/
|
||||
ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}"), check_functions = 0)
|
||||
var/stack
|
||||
var/datum/stack
|
||||
opr=new
|
||||
val=new
|
||||
src.expecting=VALUE
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
The token at <index> in <tokens>.
|
||||
*/
|
||||
curToken
|
||||
stack
|
||||
datum/stack
|
||||
blocks=new
|
||||
node/BlockDefinition
|
||||
GlobalBlock/global_block=new
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/stack
|
||||
var/list
|
||||
contents=new
|
||||
proc
|
||||
Push(value)
|
||||
contents+=value
|
||||
|
||||
Pop()
|
||||
if(!contents.len) return null
|
||||
. = contents[contents.len]
|
||||
contents.len--
|
||||
|
||||
Top() //returns the item on the top of the stack without removing it
|
||||
if(!contents.len) return null
|
||||
return contents[contents.len]
|
||||
|
||||
Copy()
|
||||
var/stack/S=new()
|
||||
S.contents=src.contents.Copy()
|
||||
return S
|
||||
|
||||
Clear()
|
||||
contents.Cut()
|
||||
Reference in New Issue
Block a user