提示コードはnanoエディタのシンタックスハイライトの設定ファイルなのですがこの設定ファイルにハイライトを追加して関数やenumを追加したいのですがこれはどうやって編集すればいいのでしょうか?例えば以下の行のcolorの次をblueに自分で編集出来たのですがこれはどんなフォーマットで書かれたものでしょうか?。下記は識別子と思われます。
nanorc
1color blue "\<(float|double|bool|char|int|short|long|sizeof|enum|void|auto|static|const|struct|union|typedef|extern|(un)?signed|inline|true|false)\>"
nanorc
1## Here is an example for C/C++. 2 3syntax c ".([ch](pp|xx)?|C|cc|c++|cu|H|hh|ii?)$" 4header "-*-.*\<C(++)?((;|\s).*)?-*-" 5magic "^(C|C++) (source|program)" 6comment "//" 7 8# Constants. 9color blue "\<[A-Z_][0-9A-Z_]+\>" 10# Labels. 11color magenta "^[[:space:]]*[A-Z_a-z]+:[[:space:]]*$" 12 13color blue "\<(float|double|bool|char|int|short|long|sizeof|enum|void|auto|static|const|struct|union|typedef|extern|(un)?signed|inline|true|false)\>" 14color blue "\<([[:lower:]][[:lower:]_]*|(u_?)?int(8|16|32|64))_t\>" 15color blue "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|override|using|mutable|volatile|register|explicit)\>" 16color blue "\<(for|if|while|do|else|case|default|switch)\>" 17color blue "\<(try|throw|catch|operator|new|delete)\>" 18color blue "\<(goto|continue|break|return)\>" 19color magenta "'([^']|(\["'abfnrtv\]))'" "'\(([0-3]?[0-7]{1,2}))'" "'\x[0-9A-Fa-f]{1,2}'" 20 21# GCC builtins. 22color cyan "__attribute__[[:space:]]*(([^)]*))" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" 23 24# Strings. In general you will want your strings and comments to come last, 25# because highlighting rules are applied in the order they are read in. 26color blue ""([^"]|\")*"" "#[[:space:]]*include[[:space:]]+<[^[:blank:]=]*>" 27# Multiline strings. This regex is VERY resource intensive, 28# and sometimes colours things that shouldn't be coloured. 29###color brightyellow start=""(\.|[^"])*\[[:space:]]*$" end="^(\.|[^"])*"" 30 31# Preprocessor directives. 32color magenta start="^[[:space:]]*#[[:space:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\])$" 33color magenta "^[[:space:]]*#[[:space:]]*(define|else|endif|include(_next)?|undef)\>" 34 35# Comments. 36color green "//.*" 37#color brightblue "//.*" 38 39color green start="/*" end="*/" 40 41# Reminders. 42color brightwhite,yellow "\<(FIXME|TODO|XXX)\>" 43 44# Trailing whitespace. 45#color ,green "[[:space:]]+$"
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。