diff --git a/autotests/folding/test.pbl.fold b/autotests/folding/test.pbl.fold
new file mode 100644
index 0000000..ce2257e
--- /dev/null
+++ b/autotests/folding/test.pbl.fold
@@ -0,0 +1,101 @@
+# Wesnoth Markup Language
+
+#textdomain wesnoth-libs
+
+
+# Wesnoth Markup Language + +#textdomain wesnoth-libs + +#define __GUI_WINDOW_HEIGHT +( + if(window_height = 0, 9999, window_height) +)#enddef + +#define __GUI_WINDOW_FUNCTIONS +def reevaluate_best_size(w, s) +( +[ + 0, +# + debug_print('window ', w), + debug_print('screen ', s) +# +][0] +); +#enddef + +# Don't highlight array indices as tags +stored_unit[1].moves +other[0][1][2] +other[foo][bar] + +foo[{MACRO}] +foo[$index] +foo[ 12 ] + +# Nested tags +[allow_undo][/allow_undo][not][true]text[/true][/not] +[foo][bar]text[/bar][/foo] + +[about] + title= _ "Campaign Designer" + text="Your Name" +[/about] + +[window] + id = "tooltip" + + [resolution] + definition = "tooltip" + automatic_placement = false + functions = "{__GUI_WINDOW_FUNCTIONS}" + + [grid] + + [row] + + [column] + + [label] + id = "label" + definition = "default_small" + + use_markup = true + wrap = true + [/label] + + [/column] + + [/row] + + [/grid] + + [/resolution] + +[/window] + +[event] + name = preload + first_time_only = no + [lua] + code = << + function narrator(t) + -- Behave like the [message] tag. + wesnoth.fire("message", + { speaker = "narrator", message = t.sentence }) + end + >> + [/lua] +[/event] + +[event] + name = turn 1 + [lua] + code = << narrator(...) >> + [args] + sentence = _ "Hello world!" + [/args] + [/lua] + [lua] + code = << narrator(...) >> + [args] + sentence = _ "How are you today?" + [/args] + [/lua] +[/event] +diff --git a/autotests/input/test.pbl b/autotests/input/test.pbl new file mode 100644 index 0000000..1d4785a --- /dev/null +++ b/autotests/input/test.pbl @@ -0,0 +1,101 @@ +# Wesnoth Markup Language + +#textdomain wesnoth-libs + +#define __GUI_WINDOW_HEIGHT +( + if(window_height = 0, 9999, window_height) +)#enddef + +#define __GUI_WINDOW_FUNCTIONS +def reevaluate_best_size(w, s) +( +[ + 0, +# + debug_print('window ', w), + debug_print('screen ', s) +# +][0] +); +#enddef + +# Don't highlight array indices as tags +stored_unit[1].moves +other[0][1][2] +other[foo][bar] + +foo[{MACRO}] +foo[$index] +foo[ 12 ] + +# Nested tags +[allow_undo][/allow_undo][not][true]text[/true][/not] +[foo][bar]text[/bar][/foo] + +[about] + title= _ "Campaign Designer" + text="Your Name" +[/about] + +[window] + id = "tooltip" + + [resolution] + definition = "tooltip" + automatic_placement = false + functions = "{__GUI_WINDOW_FUNCTIONS}" + + [grid] + + [row] + + [column] + + [label] + id = "label" + definition = "default_small" + + use_markup = true + wrap = true + [/label] + + [/column] + + [/row] + + [/grid] + + [/resolution] + +[/window] + +[event] + name = preload + first_time_only = no + [lua] + code = << + function narrator(t) + -- Behave like the [message] tag. + wesnoth.fire("message", + { speaker = "narrator", message = t.sentence }) + end + >> + [/lua] +[/event] + +[event] + name = turn 1 + [lua] + code = << narrator(...) >> + [args] + sentence = _ "Hello world!" + [/args] + [/lua] + [lua] + code = << narrator(...) >> + [args] + sentence = _ "How are you today?" + [/args] + [/lua] +[/event] diff --git a/autotests/reference/test.pbl.ref b/autotests/reference/test.pbl.ref new file mode 100644 index 0000000..ff40900 --- /dev/null +++ b/autotests/reference/test.pbl.ref @@ -0,0 +1,101 @@ +