mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-22 02:17:18 +01:00
Handle static keyword.
This commit is contained in:
parent
ab986942e0
commit
a92c488a82
@ -21,6 +21,7 @@ class GDSScope:
|
|||||||
var raw_scope_data_alt : String = ""
|
var raw_scope_data_alt : String = ""
|
||||||
var subscopes : Array = Array()
|
var subscopes : Array = Array()
|
||||||
var scope_lines : PoolStringArray = PoolStringArray()
|
var scope_lines : PoolStringArray = PoolStringArray()
|
||||||
|
var is_static : bool = false
|
||||||
|
|
||||||
func parse(contents : PoolStringArray, current_index : int = 0, current_indent : int = 0) -> int:
|
func parse(contents : PoolStringArray, current_index : int = 0, current_indent : int = 0) -> int:
|
||||||
while current_index < contents.size():
|
while current_index < contents.size():
|
||||||
@ -75,6 +76,10 @@ class GDSScope:
|
|||||||
func parse_scope_data(s : String) -> void:
|
func parse_scope_data(s : String) -> void:
|
||||||
raw_scope_data = s
|
raw_scope_data = s
|
||||||
|
|
||||||
|
if raw_scope_data.begins_with("static "):
|
||||||
|
is_static = true
|
||||||
|
raw_scope_data = raw_scope_data.trim_prefix("static ")
|
||||||
|
|
||||||
if raw_scope_data.begins_with("if "):
|
if raw_scope_data.begins_with("if "):
|
||||||
type = GDScopeType.GDSCOPE_TYPE_IF
|
type = GDScopeType.GDSCOPE_TYPE_IF
|
||||||
scope_data = raw_scope_data.trim_prefix("if ").trim_suffix(":")
|
scope_data = raw_scope_data.trim_prefix("if ").trim_suffix(":")
|
||||||
@ -220,6 +225,9 @@ class GDSScope:
|
|||||||
s += indents + " public:\n"
|
s += indents + " public:\n"
|
||||||
|
|
||||||
elif type == GDScopeType.GDSCOPE_TYPE_FUNC:
|
elif type == GDScopeType.GDSCOPE_TYPE_FUNC:
|
||||||
|
if is_static:
|
||||||
|
s += "static "
|
||||||
|
|
||||||
s += transform_method_to_cpp() + ";"
|
s += transform_method_to_cpp() + ";"
|
||||||
return s
|
return s
|
||||||
elif type == GDScopeType.GDSCOPE_TYPE_ENUM:
|
elif type == GDScopeType.GDSCOPE_TYPE_ENUM:
|
||||||
|
Loading…
Reference in New Issue
Block a user