]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cc: allow to call nested packages from within C code
authorDmitriy Vyukov <dvyukov@google.com>
Sat, 4 Aug 2012 12:11:53 +0000 (16:11 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Sat, 4 Aug 2012 12:11:53 +0000 (16:11 +0400)
E.g. sync/atomic.LoadInt32() can be called as sync»atomic·LoadInt32()

R=rsc
CC=golang-dev
https://golang.org/cl/6448057

src/cmd/cc/lex.c
src/cmd/cc/lexbody

index ac190a8cb11ec4e6e1badae09b332ffde6e94a45..653c298a243bed96e173b0652d14e1d872fc5db1 100644 (file)
@@ -377,11 +377,16 @@ lookup(void)
                symb[1] = '"';
        }
 
-       // turn · into .
        for(r=w=symb; *r; r++) {
+               // turn · (U+00B7) into .
+               // turn ∕ (U+2215) into /
                if((uchar)*r == 0xc2 && (uchar)*(r+1) == 0xb7) {
                        *w++ = '.';
                        r++;
+               }else if((uchar)*r == 0xe2 && (uchar)*(r+1) == 0x88 && (uchar)*(r+2) == 0x95) {
+                       *w++ = '/';
+                       r++;
+                       r++;
                }else
                        *w++ = *r;
        }
index 51d2e9396a8bf47730c17d7878c28417b2251adf..4cc9c73d9deec6a5d1939c2d08f6e7879aead6d1 100644 (file)
@@ -251,11 +251,16 @@ lookup(void)
                symb[1] = '"';
        }
 
-       // turn · into .
        for(r=w=symb; *r; r++) {
+               // turn · (U+00B7) into .
+               // turn ∕ (U+2215) into /
                if((uchar)*r == 0xc2 && (uchar)*(r+1) == 0xb7) {
                        *w++ = '.';
                        r++;
+               }else if((uchar)*r == 0xe2 && (uchar)*(r+1) == 0x88 && (uchar)*(r+2) == 0x95) {
+                       *w++ = '/';
+                       r++;
+                       r++;
                }else
                        *w++ = *r;
        }