diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-04-30 17:29:04 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-04-30 18:02:51 +0900 |
commit | b1657be3e0236a29562c0a261a9d2a515e117c45 (patch) | |
tree | 5ac4f7857c35489e5cb3df1da5a87af40e20dcb3 /gettext-tools/src | |
parent | 4dc36d2f6a4a544cce6cd0e9dc45a080139cd9d1 (diff) | |
download | external_gettext-b1657be3e0236a29562c0a261a9d2a515e117c45.zip external_gettext-b1657be3e0236a29562c0a261a9d2a515e117c45.tar.gz external_gettext-b1657be3e0236a29562c0a261a9d2a515e117c45.tar.bz2 |
scheme: Recognize GIMP script-fu extension _"abc"
* gettext-tools/src/x-scheme.c (read_object): Recognize _"abc".
Diffstat (limited to 'gettext-tools/src')
-rw-r--r-- | gettext-tools/src/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-tools/src/x-scheme.c | 30 |
2 files changed, 34 insertions, 1 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 98a425f..c7c953f 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,5 +1,10 @@ 2014-04-30 Daiki Ueno <ueno@gnu.org> + scheme: Recognize GIMP script-fu extension _"abc" + * x-scheme.c (read_object): Recognize _"abc". + +2014-04-30 Daiki Ueno <ueno@gnu.org> + format-python-brace: Limit acceptable format specifiers Problem reported by Kovid Goyal at: <https://savannah.gnu.org/bugs/?41668>. diff --git a/gettext-tools/src/x-scheme.c b/gettext-tools/src/x-scheme.c index 1ddcb2d..361156a 100644 --- a/gettext-tools/src/x-scheme.c +++ b/gettext-tools/src/x-scheme.c @@ -682,6 +682,7 @@ read_object (struct object *op, flag_context_ty outer_context) for (;;) { int c = do_getc (); + bool seen_underscore_prefix = false; switch (c) { @@ -1167,6 +1168,33 @@ read_object (struct object *op, flag_context_ty outer_context) abort (); } + case '_': + /* GIMP script-fu extension: '_' before a string literal is + considered a gettext call on the string. */ + { + int c = do_getc (); + if (c == EOF) + /* Invalid input. Be tolerant, no error message. */ + { + op->type = t_other; + return; + } + if (c != '"') + { + do_ungetc (c); + + /* If '_' is not followed by a string literal, + consider it a part of symbol. */ + op->token = XMALLOC (struct token); + read_token (op->token, '_'); + op->type = t_symbol; + last_non_comment_line = line_number; + return; + } + seen_underscore_prefix = true; + } + /*FALLTHROUGH*/ + case '"': { op->token = XMALLOC (struct token); @@ -1220,7 +1248,7 @@ read_object (struct object *op, flag_context_ty outer_context) } op->type = t_string; - if (extract_all) + if (seen_underscore_prefix || extract_all) { lex_pos_ty pos; |