Makes SDQL understand typepaths (#28267)

* Makes SDQL understand typepaths

* oh right

* This too
This commit is contained in:
Exxion
2020-11-28 20:27:34 -05:00
committed by GitHub
parent 7c64054462
commit 0e93656da2
2 changed files with 7 additions and 3 deletions

View File

@@ -366,7 +366,7 @@
else if(expression[i] == "null")
val = null
else if(isnum(expression[i]))
else if(isnum(expression[i]) || ispath(expression[i]))
val = expression[i]
else if(copytext(expression[i], 1, 2) in list("'", "\""))

View File

@@ -34,7 +34,7 @@
// expression : ( unary_expression | '(' expression ')' | value ) [binary_operator expression]
// unary_expression : unary_operator ( unary_expression | value | '(' expression ')' )
// comparitor : '=' | '==' | '!=' | '<>' | '<' | '<=' | '>' | '>='
// value : variable | string | number | 'null'
// value : variable | string | number | 'null' | typepath
// unary_operator : '!' | '-' | '~'
// binary_operator : comparitor | '+' | '-' | '/' | '*' | '&' | '|' | '^'
// bool_operator : 'AND' | '&&' | 'OR' | '||'
@@ -556,7 +556,7 @@
return i + 1
//value: variable | string | number | 'null'
//value: variable | string | number | 'null' | typepath
/datum/SDQL_parser/proc/value(i, list/node)
if(token(i) == "null")
node += "null"
@@ -570,11 +570,15 @@
node += text2num(token(i))
i++
else if(text2path(token(i)))
node += text2path(token(i++))
else if(copytext(token(i), 1, 2) in list("'", "\""))
i = string(i, node)
else if(copytext(token(i), 1, 2) == "\[") // Start a list.
i = array(i, node)
else
i = variable(i, node)