mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
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:
parent
bc798c544c
commit
ea92838cf3
7 changed files with 76 additions and 21 deletions
5
tests/sample_errors/bad_escape_sequence.blp
Normal file
5
tests/sample_errors/bad_escape_sequence.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Label {
|
||||
label: '***** \f *****';
|
||||
}
|
1
tests/sample_errors/bad_escape_sequence.err
Normal file
1
tests/sample_errors/bad_escape_sequence.err
Normal file
|
@ -0,0 +1 @@
|
|||
4,17,2,Invalid escape sequence '\f'
|
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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
|
||||
& 4 "5' 6</property>
|
||||
<property name="label">\\'Test 1 2 3
|
||||
& 4 "5' 6 </property>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue