dotfiles

My dotfiles.
git clone git://git.ryanmj.xyz/dotfiles.git
Log | Files | Refs | LICENSE

batch.jsf (2421B)


      1 # JOE syntax highlight file for Windows batch scripts
      2 
      3 =Idle
      4 =Comment	green
      5 =Command	bold
      6 =Statement	bold cyan
      7 =Brace		magenta
      8 =Variable	blue
      9 =Label		bold blue
     10 
     11 :reset Idle
     12 	*		linebegin	noeat
     13 	" \t\r\n"	reset
     14 
     15 :linebegin Idle
     16 	*		stmtorcommand	noeat buffer
     17 	":"		labelorcomment
     18 	"@"		linebegin
     19 	"%"		args		call=.variable() recolor=-1
     20 	"\""		qargs		recolor=-1
     21 	"'"		sqargs		recolor=-1		# These two encountered in 
     22 	"`"		bqargs		recolor=-1		# certain varieties of for-loops
     23 
     24 :stmtorcommand Command
     25 	*		command		noeat istrings
     26 	"call"		stmt
     27 	"cd"		stmt
     28 	"chdir"		stmt
     29 	"cls"		stmt
     30 	"copy"		stmt
     31 	"del"		stmt
     32 	"dir"		stmt
     33 	"echo"		echostmt
     34 	"echo."		echostmt
     35 	"endlocal"	stmt
     36 	"erase"		stmt
     37 	"exit"		stmt
     38 	"for"		stmt
     39 	"goto"		stmt
     40 	"if"		stmt
     41 	"move"		stmt
     42 	"pause"		stmt
     43 	"popd"		stmt
     44 	"pushd"		stmt
     45 	"rd"		stmt
     46 	"rem"		comment
     47 	"ren"		stmt
     48 	"rename"	stmt
     49 	"rmdir"		stmt
     50 	"set"		stmt
     51 	"setlocal"	stmt
     52 	"setx"		stmt
     53 	"shift"		stmt
     54 	"sleep"		stmt
     55 	"start"		stmt
     56 	"type"		stmt
     57 	"xcopy"		stmt
     58 done
     59 	"a-zA-Z."	stmtorcommand
     60 	"\"\\_0-9"	command
     61 	")"		rparen		recolor=-1
     62 
     63 :labelorcomment Idle
     64 	*		label		recolor=-2
     65 	":"		comment		recolor=-2
     66 
     67 :label Label
     68 	*		label
     69 	"\r\n"		reset
     70 
     71 :comment Comment
     72 	*		comment
     73 	"\r\n"		reset
     74 
     75 :stmt Statement
     76 	*		args		noeat
     77 
     78 :echostmt Statement
     79 	*		echoargs	noeat
     80 
     81 :echoargs Idle
     82 	*		echoargs
     83 	"%"		echoargs	call=.variable() recolor=-1
     84 	"&"		and		recolor=-1
     85 	"\r\n"		reset
     86 
     87 :command Command
     88 	*		command
     89 	"\""		qcommand
     90 	" \t"		args
     91 	"\r\n"		reset
     92 
     93 :qcommand Command
     94 	*		qcommand
     95 	"\""		command
     96 	"\r\n"		reset
     97 
     98 :args Idle
     99 	*		args
    100 	"%"		args		call=.variable() recolor=-1
    101 	"("		lparen		recolor=-1
    102 	")"		rparen		recolor=-1
    103 	"\r\n"		reset
    104 	"\""		qargs			
    105 	"&"		and		recolor=-1
    106 
    107 # Double-quoted args
    108 :qargs Idle
    109 	*		qargs
    110 	"\""		args
    111 	"%"		qargs		call=.variable() recolor=-1
    112 	"\r\n"		reset
    113 
    114 # Single-quoted args
    115 :sqargs Idle
    116 	*		sqargs
    117 	"'"		args
    118 	"%"		sqargs		call=.variable() recolor=-1
    119 	"\r\n"		reset
    120 
    121 # Back-quoted (`) args, found in some for-loops
    122 :bqargs Idle
    123 	*		bqargs
    124 	"`"		args
    125 	"%"		bqargs		call=.variable() recolor=-1
    126 	"\r\n"		reset
    127 
    128 :and Idle
    129 	*		reset		noeat
    130 
    131 :lparen Brace
    132 	*		linebegin	noeat
    133 
    134 :rparen Brace
    135 	*		args		noeat
    136 
    137 .subr variable
    138 
    139 :variable Variable
    140 	*		args		noeat return
    141 	"%~"		shortvar
    142 	"\*"		noeat		return
    143 	"0-9"		variable	return
    144 	"A-Za-z_"	varbody
    145 
    146 :shortvar Variable
    147 	*		args		noeat return
    148 	"A-Za-z0-9_"	shortvar
    149 
    150 :varbody Variable
    151 	*		varbody
    152 	"%"		args		return
    153 
    154 .end