aboutsummaryrefslogtreecommitdiff
path: root/demos/misc/regex
diff options
context:
space:
mode:
authorRémi Verschelde2015-12-09 08:38:23 +0100
committerRémi Verschelde2015-12-09 08:38:23 +0100
commit8639cecf4cedd56452b47503be19c44b304cd02f (patch)
treee2a795da15e40c7d9d5b82e33378f8dbf0eaf67a /demos/misc/regex
parentefbb834936fdc9da9789ad37c9cc61e0b90cda95 (diff)
downloadgodot-8639cecf4cedd56452b47503be19c44b304cd02f.tar.gz
godot-8639cecf4cedd56452b47503be19c44b304cd02f.tar.zst
godot-8639cecf4cedd56452b47503be19c44b304cd02f.zip
Improve code formatting and update to 2.0
The scripts were streamlined using more or less the following conventions: - space after a comma in lists of arguments - space around weak operators (+, -), no space around strong operators (*, /) - space after a comment start (#) - removed trailing spaces or tabs, apart from those that delimit the function indentation level (those could be removed too but since they are added automatically by the editor when typing code, keeping them for now) - function blocks separate by two newlines The scene files were resaved with the (current) 2.0 format, and some scenes that were in XML format were converted to SCN, to be consistent across all demos.
Diffstat (limited to 'demos/misc/regex')
-rw-r--r--demos/misc/regex/regex.gd6
-rw-r--r--demos/misc/regex/regex.scnbin1793 -> 1775 bytes
2 files changed, 5 insertions, 1 deletions
diff --git a/demos/misc/regex/regex.gd b/demos/misc/regex/regex.gd
index 409b4cab0..4921f4ff2 100644
--- a/demos/misc/regex/regex.gd
+++ b/demos/misc/regex/regex.gd
@@ -1,11 +1,15 @@
+
extends VBoxContainer
+# member variables
var regex = RegEx.new()
+
func update_expression(text):
regex.compile(text)
update_text()
+
func update_text():
var text = get_node("Text").get_text()
var list = get_node("List")
@@ -18,7 +22,7 @@ func update_text():
label.set_text(res)
list.add_child(label)
+
func _ready():
get_node("Text").set_text("They asked me \"What's going on \\\"in the manor\\\"?\"")
update_expression(get_node("Expression").get_text())
-
diff --git a/demos/misc/regex/regex.scn b/demos/misc/regex/regex.scn
index 1f46521d0..debd55504 100644
--- a/demos/misc/regex/regex.scn
+++ b/demos/misc/regex/regex.scn
Binary files differ