Parse escape sequences instead of using replace

That way we can warn about invalid sequences. Also, the previous code had at least one subtle bug (`\\\\'`).
This commit is contained in:
James Westman 2023-09-28 14:41:12 -05:00
parent bc798c544c
commit ea92838cf3
7 changed files with 76 additions and 21 deletions

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
Label {
label: '***** \f *****';
}

View file

@ -0,0 +1 @@
4,17,2,Invalid escape sequence '\f'

View file

@ -1,5 +1,5 @@
using Gtk 4.0;
Label {
label: "Test 1 2 3\n & 4 \"5\' 6";
label: "\\\\'Test 1 2 3\n & 4 \"5\' 6 \t";
}

View file

@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkLabel">
<property name="label">Test 1 2 3
&amp; 4 "5' 6</property>
<property name="label">\\'Test 1 2 3
&amp; 4 "5' 6 </property>
</object>
</interface>