2014/06/03

元ネタ
「:」を引数の名前と型の間に入れられるようしたりにする魔改造 - moriyoshiの日記

とある言語が func halfOpenRangeLength(start: Int, end: Int) -> Int { return end - start } println (halfOpe...

http://moriyoshi.hatenablog.com/entry/2014/06/03/114845
Go のソースを落としてきて diff -r fde405c62fca src/cmd/gc/lex.c
--- a/src/cmd/gc/lex.c  Tue Jun 03 11:44:17 2014 +0900
+++ b/src/cmd/gc/lex.c  Tue Jun 03 12:49:01 2014 +0900
@@ -1308,6 +1308,11 @@
        if(c >= Runeself) {
            ungetc(c);
            rune = getr();
+           if (rune == 0x261c) {
+               c = LCOMM;
+               goto lx;
+           }
+
            // 0xb7 · is used for internal names
            if(!isalpharune(rune) && !isdigitrune(rune) && (importpkg == nil || rune != 0xb7))
                yyerror("invalid identifier character U+%04x", rune);
を当てて $ (cd src/cmd/gc && rm y.tab.h && make) とする。 package main

import (
    "fmt"
)

func main() {
    鼻 := make(chan string)
    go func() {
        鼻 ☜ "ハナクソ"
    }()

    fmt.Println(☜鼻)
}
$ go run test.go
ハナクソ
どーん
Posted at 12:54 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.