mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpgscm: Change associativity of ::.
* tests/gpgscm/scheme.c (mk_atom): Change associativity of the ::
infix-operator. This makes it possible to naturally express accessing
nested structures (e.g. a:🅱️:c).
Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
3949cbd112
commit
a45dc0849d
@ -1409,14 +1409,23 @@ static pointer mk_atom(scheme *sc, char *q) {
|
||||
int has_fp_exp = 0;
|
||||
|
||||
#if USE_COLON_HOOK
|
||||
if((p=strstr(q,"::"))!=0) {
|
||||
char *next;
|
||||
next = p = q;
|
||||
while ((next = strstr(next, "::")) != 0) {
|
||||
/* Keep looking for the last occurrence. */
|
||||
p = next;
|
||||
next = next + 2;
|
||||
}
|
||||
|
||||
if (p != q) {
|
||||
*p=0;
|
||||
return cons(sc, sc->COLON_HOOK,
|
||||
cons(sc,
|
||||
cons(sc,
|
||||
sc->QUOTE,
|
||||
cons(sc, mk_atom(sc,p+2), sc->NIL)),
|
||||
cons(sc, mk_symbol(sc,strlwr(q)), sc->NIL)));
|
||||
cons(sc, mk_symbol(sc, strlwr(p + 2)),
|
||||
sc->NIL)),
|
||||
cons(sc, mk_atom(sc, q), sc->NIL)));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user