「Go/ソースコードの表現方法」の版間の差分

削除された内容 追加された内容
Ef3 (トーク | 投稿記録)
タグ: 2017年版ソースエディター
Ef3 (トーク | 投稿記録)
s/source/syntaxhighlight/
タグ: 2017年版ソースエディター
24 行
 
 
;パッケージ "golang.org/x/text/encoding/japanese" のインストール:<sourcesyntaxhighlight lang=powershell>
PowerShell 7.1.4
Copyright (c) Microsoft Corporation.
39 行
golang.org/x/text/encoding/japanese
PS C:\Users\eguchi>
</syntaxhighlight>
</source>
 
;ShiftJISでエンコードされたファイルを(別の)ファイルにEUC-JPエンコーディングで書き出す関数:<sourcesyntaxhighlight lang=go>
package conversion
 
65 行
return nil
}
</syntaxhighlight>
</source>
 
== 文字 ==
以下の用語は、特定のUnicode文字クラスを示すために使用されます。
 
;文字:<sourcesyntaxhighlight lang=ebnf>
newline = (* UnicodeコードポイントU+000A *) ;
unicode_char = (* newline を除く任意の Unicode コードポイント *) ;
unicode_letter = (* "Letter "に分類されるUnicodeコードポイント *) ;
unicode_digit = (* "Number, decimal digit" に分類される Unicode コードポイント *) ;
</syntaxhighlight>
</source>
 
The Unicode Standard 8.0の4.5項「General Category」では、一連の文字カテゴリが定義されています。
82 行
== 文字と数字 ==
アンダースコア文字「_」(U+005F)は、文字とみなされます。
;文字と数字:<sourcesyntaxhighlight lang=ebnf>
letter = unicode_letter | "_" ;
decimal_digit = "0" ... "9" ;
88 行
octal_digit = "0" … "7" ;
hex_digit = "0" ... "9" | "A" ... "F" | "a" ... "f" ;
</syntaxhighlight>
</source>
 
{{Nav}}
== 脚註 ==
<references />