[afblue.pl]: Minor improvements.

* src/tools/afblue.pl: Allow whitespace before comments.
Ignore whitespace in strings.
This commit is contained in:
Werner Lemberg 2014-04-15 16:47:05 +02:00
parent 8b1f2a6cda
commit 181fd071ee
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2014-04-15 Werner Lemberg <wl@gnu.org>
[afblue.pl]: Minor improvements.
* src/tools/afblue.pl: Allow whitespace before comments.
Ignore whitespace in strings.
2014-04-14 Werner Lemberg <wl@gnu.org>
[autofit] Improve coverage handling.

View File

@ -63,8 +63,8 @@ my $enum_element_re = qr/ ^ \s* ( [A-Za-z0-9_]+ ) \s* $ /x;
# '#' <preprocessor directive> '\n'
my $preprocessor_re = qr/ ^ \# /x;
# '/' '/' <comment> '\n'
my $comment_re = qr| ^ // |x;
# [<ws>] '/' '/' <comment> '\n'
my $comment_re = qr| ^ \s* // |x;
# empty line
my $whitespace_only_re = qr/ ^ \s* $ /x;
@ -159,6 +159,9 @@ sub convert_ascii_chars
# A series of ASCII characters in the printable range.
my $s = shift;
# We ignore spaces.
$s =~ s/ //g;
my $count = $s =~ s/\G(.)/'$1', /g;
$curr_offset += $count;
$curr_elem_size += $count;