diff options
author | Andy Wingo <wingo@pobox.com> | 2019-09-12 21:45:26 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2019-09-12 21:50:35 +0200 |
commit | 4e89d0c061c585ca56a96ef8410dad17979ca5eb (patch) | |
tree | e0ab410bed78b2140020f089f7aed2a6ced1b255 /module/language/tree-il/analyze.scm | |
parent | d1cf8928802843a14c53f2a2de55bf01e75e2662 (diff) | |
download | guile-4e89d0c061c585ca56a96ef8410dad17979ca5eb.tar.gz |
Use "G_" as the conventional alias for gettext
Since the change in 2.2 noted in the NEWS as "Fix literal matching for
module-bound literals", defining `_' makes `syntax-rules' and `match'
fail to recognize `_' as the catch-all literal. This change adapts the
recommendations to current practice in 2.2, as users have had to adapt
to this change.
* doc/ref/api-i18n.texi (Gettext Support): Update documentation.
* module/language/tree-il/analyze.scm (proc-ref?, gettext?): G_ is the
conventional abbreviation, not _.
* test-suite/tests/tree-il.test: Adapt.
* module/ice-9/command-line.scm: Use G_ instead of _.
Diffstat (limited to 'module/language/tree-il/analyze.scm')
-rw-r--r-- | module/language/tree-il/analyze.scm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index eb83a8ea5..bc98f8213 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -1,6 +1,6 @@ ;;; TREE-IL -> GLIL compiler -;; Copyright (C) 2001, 2008-2014, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2001,2008-2014,2016,2018-2019 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -1422,7 +1422,7 @@ resort, return #t when EXP refers to the global variable SPECIAL-NAME." (match exp (($ <toplevel-ref> _ _ (? special?)) - ;; Allow top-levels like: (define _ (cut gettext <> "my-domain")). + ;; Allow top-levels like: (define G_ (cut gettext <> "my-domain")). #t) (($ <toplevel-ref> _ _ name) (let ((var (module-variable env name))) @@ -1440,7 +1440,7 @@ resort, return #t when EXP refers to the global variable SPECIAL-NAME." #t) (_ #f))) -(define gettext? (cut proc-ref? <> gettext '_ <>)) +(define gettext? (cut proc-ref? <> gettext 'G_ <>)) (define ngettext? (cut proc-ref? <> ngettext 'N_ <>)) (define (const-fmt x env) @@ -1450,7 +1450,7 @@ resort, return #t when EXP refers to the global variable SPECIAL-NAME." exp) (($ <call> _ (? (cut gettext? <> env)) (($ <const> _ (? string? fmt)))) - ;; Gettexted literals, like `(_ "foo")'. + ;; Gettexted literals, like `(G_ "foo")'. fmt) (($ <call> _ (? (cut ngettext? <> env)) (($ <const> _ (? string? fmt)) ($ <const> _ (? string?)) _ ..1)) |