HSP3.hilight Ver.1.20b2

HSP3.hilight Ver.1.20b2 適用サンプル

HSP コンパイルマクロもライブラリに投げたことだし、 hilight の方も更新しようと思って。

変更箇所

Ver.1.20b1 からの変更点は以下の通り

演算子の強調定義を削除した。

いらないと思って。

強調表示の順番が変更された。

以下のように。

強調の対象強調の種類(変更前)強調の種類(変更後)
演算子強調1削除
ラベル強調2強調6
マクロ強調3強調1
フロー制御命令強調4強調5
命令強調5強調4
関数強調6強調3
システム変数強調7強調2
プリプロセッサ命令のキーワード強調8強調7
プリプロセッサ命令強調8強調8
モジュールの行行の強調1行の強調1
ユーザー定義命令/関数行の強調2行の強調2
ラベル定義行の強調3行の強調2

デザイン周りを調整。

文字の色やスタイルといったデザイン周りを調整しました。太字部分が少なくなって色も落ち着いているかと思います。

数値リテラルの強調を追加。

数値リテラルを秀丸標準のものではなく新たに強調表示に加えました。 HSP 独自の $abcd%1010 のような 16 進数 / 2 進数表記に対応していなかったからです。

#if 0#endif の部分を無効部分として強調表示するように変更

#if 0#endif の部分を無効部分として強調表示するように変更しました。ただし、その中で #if#ifdef をネストしていると強調がうまくいきません。(秀丸にはもともと #if#ifdef で無効表示にできる機能があるのですが、それは複数行コメントの言語指定が C言語/Java でないと使えませんでした。)

これからの予定

行の強調がコメントや文字列リテラル内でも有効なのをどうにかできないかと色々試してみたのですが、うまい方法は見つかりませんでした。(複数行コメントの方で強調を登録して優先度をコメントや文字列リテラルより下にすればうまくいくのではないかと考えたものの、それだと強調の背景色が幅いっぱいまで塗られないし、アウトライン解析に反映されなくなります。)

あとは #define で定義するマクロの引数( %1, %2, %3... )の強調をなんとか出来ないか、パラメータタイプの強調で誤認識があるのをなんとか出来ないかと考えてます。

調整していたらいつまでも終わらないので、どこかでキリをつけてライブラリにアップしなければいけません。

HSP3.hilight Ver1.20b2 の中身

//**************************************************************************************************
//     HSP3.hilight Ver.1.2b2
//         Hot Soup Processor 3.x のスクリプトの秀丸エディタ強調表示定義ファイル
//                                                                          Last Update: 2007/12/17
//                                                                                  Author: fujidig
//                                                                          http://www.fujidig.com/
//                                                                             fuji.rosen@gmail.com
//**************************************************************************************************

//==================================================================================================
// ■ 強調表示
//==================================================================================================

//--------------------------------------------------------------------------------------------------
// □ マクロ
//  ( 大文字小文字の区別 : OFF / 単語の検索 : ON / 正規表現 : OFF / 強調1 )
//--------------------------------------------------------------------------------------------------

41,__date__
41,__file__
41,__hsp30__
41,__hspver__
41,__line__
41,__time__
41,_debug

41,font_antialias
41,font_bold
41,font_italic
41,font_normal
41,font_strikeout
41,font_underline
41,gmode_add
41,gmode_alpha
41,gmode_gdi
41,gmode_mem
41,gmode_pixela
41,gmode_rgb0
41,gmode_rgb0alpha
41,gmode_sub
41,msgothic
41,msmincho
41,objmode_guifont
41,objmode_normal
41,objmode_usefont
41,screen_fixedsize
41,screen_frame
41,screen_hide
41,screen_normal
41,screen_palette
41,screen_tool

//--------------------------------------------------------------------------------------------------
// □ システム変数・システム変数のようなマクロ
//  ( 大文字小文字の区別 : OFF / 単語の検索 : ON / 正規表現 : OFF / 強調2 )
//--------------------------------------------------------------------------------------------------

105,cnt
105,err
105,hdc
105,hinstance
105,hspstat
105,hspver
105,hwnd
105,iparam
105,looplev
105,lparam
105,mousew
105,mousex
105,mousey
105,refdval
105,refstr
105,stat
105,strsize
105,sublev
105,thismod
105,wparam

105,dir_cmdline
105,dir_cur
105,dir_desktop
105,dir_exe
105,dir_mydoc
105,dir_sys
105,dir_win
105,ginfo_act
105,ginfo_b
105,ginfo_cx
105,ginfo_cy
105,ginfo_dispx
105,ginfo_dispy
105,ginfo_g
105,ginfo_intid
105,ginfo_mesx
105,ginfo_mesy
105,ginfo_mx
105,ginfo_my
105,ginfo_paluse
105,ginfo_r
105,ginfo_sel
105,ginfo_sizex
105,ginfo_sizey
105,ginfo_sx
105,ginfo_sy
105,ginfo_vx
105,ginfo_vy
105,ginfo_winx
105,ginfo_winy
105,ginfo_wx1
105,ginfo_wx2
105,ginfo_wy1
105,ginfo_wy2
105,notemax
105,notesize

//--------------------------------------------------------------------------------------------------
// □ 標準関数・関数のようなマクロ
//  ( 大文字小文字の区別 : OFF / 単語の検索 : ON / 正規表現 : OFF / 強調3 )
//--------------------------------------------------------------------------------------------------

169,abs
169,absf
169,atan
169,callfunc
169,cnvwtos
169,comevdisp
169,cos
169,dirinfo
169,double
169,expf
169,getpath
169,gettime
169,ginfo
169,instr
169,int
169,length
169,length2
169,length3
169,length4
169,libptr
169,limit
169,limitf
169,logf
169,lpeek
169,noteinfo
169,objinfo
169,peek
169,rnd
169,sin
169,sqrt
169,str
169,strf
169,strlen
169,strmid
169,sysinfo
169,tan
169,varptr
169,vartype
169,varuse
169,wpeek

169,objinfo_bmscr
169,objinfo_hwnd
169,objinfo_mode

//--------------------------------------------------------------------------------------------------
// □ 標準命令・命令のようなマクロ
//  ( 大文字小文字の区別 : OFF / 単語の検索 : ON / 正規表現 : OFF / 強調4 )
//--------------------------------------------------------------------------------------------------

// 標準命令
233,assert
233,await
233,axobj
233,bcopy
233,bgscr
233,bload
233,bmpsave
233,boxf
233,bsave
233,buffer
233,button
233,chdir
233,chdpm
233,chgdisp
233,chkbox
233,circle
233,clrobj
233,cls
233,cnvstow
233,color
233,combox
233,comevarg
233,comevent
233,comres
233,delcom
233,delete
233,delmod
233,dialog
233,dim
233,dimtype
233,dirlist
233,dup
233,dupptr
233,exec
233,exist
233,font
233,gcopy
233,getkey
233,getstr
233,gmode
233,grect
233,groll
233,grotate
233,gsel
233,gsquare
233,gzoom
233,hsvcolor
233,input
233,line
233,listbox
233,logmes
233,lpoke
233,mcall
233,mci
233,memcpy
233,memexpand
233,memfile
233,memset
233,mes
233,mesbox
233,mkdir
233,mmload
233,mmplay
233,mmstop
233,mouse
233,mref
233,newcom
233,newmod
233,noteadd
233,notedel
233,noteget
233,noteload
233,notesave
233,notesel
233,noteunsel
233,objmode
233,objprm
233,objsel
233,objsize
233,onclick
233,oncmd
233,onerror
233,onexit
233,onkey
233,palcolor
233,palette
233,pget
233,picload
233,poke
233,pos
233,print
233,pset
233,querycom
233,randomize
233,redraw
233,sarrayconv
233,screen
233,sdim
233,sendmsg
233,stick
233,stop
233,syscolor
233,sysfont
233,system
233,title
233,wait
233,width
233,winobj
233,wpoke

233,alloc
233,ddim

//--------------------------------------------------------------------------------------------------
// □ プログラム制御命令/マクロ
//  ( 大文字小文字の区別 : OFF / 単語の検索 : ON / 正規表現 : OFF / 強調5 )
//--------------------------------------------------------------------------------------------------

299,if
299,else
299,break
299,continue
299,end
299,return
299,repeat
299,loop
299,goto
299,gosub
299,foreach
299,exgoto
299,on
299,run

299,_break
299,_continue
299,case
299,default
299,do
299,for
299,next
299,swbreak
299,swend
299,switch
299,until
299,wend
299,while

//--------------------------------------------------------------------------------------------------
// □ ラベル
//  ( 大文字小文字の区別 : ON / 単語の検索 : OFF / 正規表現 : ON / 強調6 )
//--------------------------------------------------------------------------------------------------

339,(?<=([(,:=]|^|([\t (,]|^)[\t ]*(goto|gosub)|(:|^)[\t ]*[A-Z_a-z@`。-゚、-黑][0-9A-Z_a-z@`。-゚ -黑]*)[\t ]*)\*[A-Z_a-z@`。-゚、-黑][0-9A-Z_a-z@`。-゚ -黑]*

//--------------------------------------------------------------------------------------------------
// □ プリプロセッサ命令のキーワードなど
//  ( 大文字小文字の区別 : ON / 単語の検索 : ON / 正規表現 : ON / 強調7 )
//--------------------------------------------------------------------------------------------------

// 命令のキーワードなど
435,(?<=^[ \t]*#[ \t]*packopt[ \t]+)(name|runtime|type|xsize|ysize|hide|orgpath)
435,(?<=^[ \t]*#[ \t]*cmpopt[ \t]+)(ppout|optcode|optinfo|varname)
435,(?<=^[ \t]*#[ \t]*aht[ \t]+)(class|name|author|ver|exp|icon|iconid)
435,(?<=^[ \t]*#[ \t]*(func|cfunc|define|const|enum|comfunc)[ \t]+)global
435,(?<=^[ \t]*#[ \t]*define[ \t]+(global[ \t]+)?)ctype
435,(?<=^[ \t]*#[ \t]*const[ \t]+(global[ \t]+)?)double
435,(?<=^[ \t]*#[ \t]*(deffunc|defcfunc)[ \t]+)local
435,(?<=^[ \t]*#[ \t]*(deffunc|defcfunc)[ \t]+(local[ \t]+)?[A-Z_a-z@`。-゚、-黑][0-9A-Z_a-z@`。-゚ -黑]*[ \t]+)onexit
435,(?<=^[ \t]*#[ \t]*(func|cfunc)[ \t]+[A-Z_a-z@`。-゚、-黑][0-9A-Z_a-z@`。-゚ -黑]*[ \t]+)onexit

// パラメータタイプ
435,(?<=[, \t])(int|var|array|str|double|label|local)(?=[ \t]+[A-Z_a-z@`。-゚、-黑])
435,(?<=[, \t])(bmscr|comobj|double|float|hdc|hinst|hwnd|int|label|nullptr|pexinfo|prefstr|pval|sptr|str|var|wptr|wstr)(?=[ \t]*(,|$))

//--------------------------------------------------------------------------------------------------
// □ プリプロセッサ命令
//  ( 大文字小文字の区別 : ON / 単語の検索 : ON / 正規表現 : ON / 強調8 )
//--------------------------------------------------------------------------------------------------

499,(?<=^[ \t]*)#[ \t]*(uselib|usecom|undef|runtime|regcmd|packopt|pack|module|modterm|modinit|modfunc|include|ifndef|ifdef|if|global|func|epack|enum|endif|else|define|deffunc|defcfunc|const|comfunc|cmpopt|cmd|cfunc|ahtmes|aht|addition)

//--------------------------------------------------------------------------------------------------
// □ モジュール/関数/ラベルの行の強調
//  ( 大文字小文字の区別 : ON / 単語の検索 : OFF / 正規表現 : ON / 行の強調1~2 )
//--------------------------------------------------------------------------------------------------

21,^[ \t]*#[ \t]*(module|global)
85,^[ \t]*#[ \t]*(modinit|modfunc|modterm|deffunc|defcfunc)
85,^[ \t]*\*[A-Z_a-z`。-゚、-黑][0-9A-Z_a-z@`。-゚ -黑]*

//==================================================================================================
// ■ 複数行の強調
//==================================================================================================

/<HilightMulti>

//--------------------------------------------------------------------------------------------------
// □ 文字列リテラル・文字コード
//--------------------------------------------------------------------------------------------------

/0003,00000003,00,00,00000002,"//",00000002,""
/0003,00000003,00,00,00000002,";",00000002,""
/0003,00000002,00,00,00000002,"/*",00000002,"*/"

//--------------------------------------------------------------------------------------------------
// □ コメント
//--------------------------------------------------------------------------------------------------

/0014,00000002,00,5C,00010003,"(?<={)\"",00010003,"\"(?=})"
/0014,00000002,00,5C,00000002,"\"",00010003,"\"|$"
/0014,00000002,00,5C,00000002,"'",00010003,"'|$"

//--------------------------------------------------------------------------------------------------
// □ #if 0 ~ #endif 
//--------------------------------------------------------------------------------------------------

/001A,00000000,00,00,00010003,"^[ \\t]*#[ \\t]*if[ \\t]+0[ \\t]*$",00010003,"^(?=[ \\t]*#[ \\t]*(endif|else))"

//--------------------------------------------------------------------------------------------------
// □ 数値リテラル
//--------------------------------------------------------------------------------------------------

/0005,00000004,00,00,00010001,"\\$[0-9a-f]+",00000002,""
/0005,00000004,00,00,00010001,"(?<=[^0-9a-z_a-z@`。-゚ -黑])0x[0-9a-f]+",00000002,""
/0005,00000004,00,00,00010001,"%[01]+",00000002,""
/0005,00000004,00,00,00010001,"(?<=[^0-9a-z_a-z@`。-゚ -黑])0b[01]+",00000002,""
/0005,00000004,00,00,00010005,"-?[0-9]+(\\.[0-9]*)?(e[-+]?[0-9]+|f)?",00000002,""

//==================================================================================================
// ■ ツリー定義
//==================================================================================================

/<TreeWord>
/0000,0000,0000,00000001,00000112,"","モジュール"
/0001,0000,0000,00000080,00000112,"","関数/ラベル"

//==================================================================================================
// ■ カラー
//==================================================================================================

/<ColorSet>
/[0][0]:0x01000008
/[0][1]:0x01000005
/[0][2]:0x00000000
/[1][0]:0x01000008
/[1][1]:0x02000000
/[1][2]:0x00000000
/[2][0]:0x01000008
/[2][1]:0x02000000
/[2][2]:0x00000001
/[3][0]:0x00008000
/[3][1]:0x02000000
/[3][2]:0x00000000
/[4][0]:0x00800000
/[4][1]:0x02000000
/[4][2]:0x00000000
/[5][0]:0x00C08000
/[5][1]:0x02000000
/[5][2]:0x00000000
/[6][0]:0x02000000
/[6][1]:0x00C8C8C8
/[6][2]:0x0000000B
/[7][0]:0x00008080
/[7][1]:0x02000000
/[7][2]:0x00000000
/[8][0]:0x000000FF
/[8][1]:0x02000000
/[8][2]:0x00000001
/[9][0]:0x02000000
/[9][1]:0x00E2E2E2
/[9][2]:0x0000000B
/[10][0]:0x01000005
/[10][1]:0x00008000
/[10][2]:0x00000000
/[11][0]:0x00800080
/[11][1]:0x02000000
/[11][2]:0x00000002
/[12][0]:0x00800000
/[12][1]:0x02000000
/[12][2]:0x00000002
/[13][0]:0x00808000
/[13][1]:0x02000000
/[13][2]:0x00000000
/[14][0]:0x00800080
/[14][1]:0x02000000
/[14][2]:0x00000000
/[15][0]:0x00000080
/[15][1]:0x02000000
/[15][2]:0x00000000
/[16][0]:0x00808000
/[16][1]:0x01000005
/[16][2]:0x00000000
/[17][0]:0x0100000E
/[17][1]:0x0100000D
/[17][2]:0x00000000
/[18][0]:0x00808080
/[18][1]:0x01000005
/[18][2]:0x00000000
/[19][0]:0x00808080
/[19][1]:0x01000005
/[19][2]:0x00000000
/[20][0]:0x00006AD5
/[20][1]:0x02000000
/[20][2]:0x00000000
/[21][0]:0x00008080
/[21][1]:0x02000000
/[21][2]:0x00000002
/[22][0]:0x00FF0000
/[22][1]:0x02000000
/[22][2]:0x00000000
/[23][0]:0x00800080
/[23][1]:0x02000000
/[23][2]:0x00000001
/[24][0]:0x01000008
/[24][1]:0x02000000
/[24][2]:0x00000001
/[25][0]:0x01000008
/[25][1]:0x02000000
/[25][2]:0x00000001
/[26][0]:0x00C0C0C0
/[26][1]:0x02000000
/[26][2]:0x00000000
/[27][0]:0x00000080
/[27][1]:0x01000005
/[27][2]:0x00000000
/[28][0]:0x00C0C0C0
/[28][1]:0x01000005
/[28][2]:0x00000000
/[29][0]:0x00808000
/[29][1]:0x01000005
/[29][2]:0x00000000
/[30][0]:0x01000008
/[30][1]:0x01000005
/[30][2]:0x00000000
/[31][0]:0x00E0E0E0
/[31][1]:0x01000005
/[31][2]:0x00000000
/[32][0]:0x000000FF
/[32][1]:0x01000005
/[32][2]:0x00000000
/[33][0]:0x00C0C0C0
/[33][1]:0x01000005
/[33][2]:0x00000000
/[34][0]:0x01000008
/[34][1]:0x0000FFFF
/[34][2]:0x00000001
/[35][0]:0x000000FF
/[35][1]:0x01000005
/[35][2]:0x00000000
/[36][0]:0x000000FF
/[36][1]:0x02000000
/[36][2]:0x00000001
/[37][0]:0x00808000
/[37][1]:0x02000000
/[37][2]:0x00000001
/[38][0]:0x00404080
/[38][1]:0x02000000
/[38][2]:0x00000000
/[39][0]:0x00404080
/[39][1]:0x02000000
/[39][2]:0x00000001
/[40][0]:0x0000FF00
/[40][1]:0x02000000
/[40][2]:0x00000001
/[41][0]:0x00FF00FF
/[41][1]:0x02000000
/[41][2]:0x00000001
/[42][0]:0x00FFFFFF
/[42][1]:0x00808000
/[42][2]:0x00000000
/[43][0]:0x00FFFFFF
/[43][1]:0x00800080
/[43][2]:0x00000000
/[44][0]:0x00FF0000
/[44][1]:0x02000000
/[44][2]:0x00000000
/[45][0]:0x00FFFFFF
/[45][1]:0x00808080
/[45][2]:0x00000000
/[46][0]:0x00808080
/[46][1]:0x00E0E0E0
/[46][2]:0x00000000
/[47][0]:0x00808000
/[47][1]:0x02000000
/[47][2]:0x00000000
/[48][0]:0x01000005
/[48][1]:0x01000008
/[48][2]:0x00000000
/[49][0]:0x02000000
/[49][1]:0x02000000
/[49][2]:0x00000000
/[50][0]:0x00000000
/[50][1]:0x00000000
/[50][2]:0x00000000
/<ColorSetEx>
CurLineColorEx:0x00000080
RulerColorEx:0xFFFFFFFF
RulerBackEx:0xFFFFFFFF

//**************************************************************************************************

インフォメーション

公開日時
2007年12月17日 午後10時42分16秒
最終更新日時
2007年12月25日 午後1時18分1秒
カテゴリ
秀丸エディタ