neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

euphoria4.vim (14538B)


      1 " Vim syntax file
      2 " Language:	Euphoria 4.0.5 (http://www.openeuphoria.org/)
      3 " Maintainer:	Shian Lee  
      4 " Last Change:	2014 Feb 26 (for Vim 7.4)
      5 " Remark:       Euphoria has two syntax files, euphoria3.vim and euphoria4.vim; 
      6 "               For details see :help ft-euphoria-syntax
      7 
      8 " quit when a syntax file was already loaded
      9 if exists("b:current_syntax")
     10  finish
     11 endif
     12 
     13 " Reset compatible-options to Vim default value, just in case: 
     14 let s:save_cpo = &cpo
     15 set cpo&vim
     16 
     17 " Should suffice for very long strings and expressions:
     18 syn sync lines=40
     19 
     20 " Euphoria is a case-sensitive language (with only 4 builtin types):
     21 syntax case match 
     22 
     23 " Some keywords/Builtins for Debug - from $EUDIR/include/euphoria/keywords.e:
     24 syn keyword euphoria4Debug	with without trace profile batch check indirect 
     25 syn keyword euphoria4Debug	includes inline warning define
     26 
     27 " Keywords for conditional compilation - from $EUDIR/include/euphoria/keywords.e:
     28 syn keyword euphoria4PreProc	elsedef elsifdef ifdef 
     29 
     30 " Keywords (Statements) - from $EUDIR/include/euphoria/keywords.e:
     31 syn keyword euphoria4Keyword	and as break by case constant continue do else     
     32 syn keyword euphoria4Keyword	elsif end entry enum exit export
     33 syn keyword euphoria4Keyword	fallthru for function global goto if include
     34 syn keyword euphoria4Keyword	label loop namespace not or override procedure
     35 syn keyword euphoria4Keyword	public retry return routine switch then to type
     36 syn keyword euphoria4Keyword	until while xor
     37 
     38 " Builtins (Identifiers) - from $EUDIR/include/euphoria/keywords.e:
     39 syn keyword euphoria4Builtin	abort and_bits append arctan atom c_func c_proc 
     40 syn keyword euphoria4Builtin	call call_func call_proc clear_screen close 
     41 syn keyword euphoria4Builtin	command_line compare cos date delete delete_routine 
     42 syn keyword euphoria4Builtin	equal find floor get_key getc getenv gets hash 
     43 syn keyword euphoria4Builtin	head include_paths insert integer length log 
     44 syn keyword euphoria4Builtin	machine_func machine_proc match mem_copy mem_set 
     45 syn keyword euphoria4Builtin	not_bits object open option_switches or_bits peek 
     46 syn keyword euphoria4Builtin	peek2s peek2u peek4s peek4u peek_string peeks pixel 
     47 syn keyword euphoria4Builtin	platform poke poke2 poke4 position power prepend 
     48 syn keyword euphoria4Builtin	print printf puts rand remainder remove repeat 
     49 syn keyword euphoria4Builtin	replace routine_id sequence sin splice sprintf
     50 syn keyword euphoria4Builtin	sqrt system system_exec tail tan task_clock_start
     51 syn keyword euphoria4Builtin	task_clock_stop task_create task_list task_schedule
     52 syn keyword euphoria4Builtin	task_self task_status task_suspend task_yield time
     53 syn keyword euphoria4Builtin	xor_bits
     54 " Builtins (Identifiers) shortcuts for length() and print():
     55 syn match   euphoria4Builtin	"\$" 
     56 syn match   euphoria4Builtin	"?"
     57 
     58 " Library Identifiers (Function) - grep from $EUDIR/include/*:
     59 syn keyword euphoria4Library	DEP_on SyntaxColor abbreviate_path abs absolute_path
     60 syn keyword euphoria4Library 	accept add add_item all_copyrights all_matches
     61 syn keyword euphoria4Library	allocate allocate_code allocate_data allocate_low
     62 syn keyword euphoria4Library 	allocate_pointer_array allocate_protect
     63 syn keyword euphoria4Library 	allocate_string allocate_string_pointer_array
     64 syn keyword euphoria4Library	allocate_wstring allocations allow_break any_key
     65 syn keyword euphoria4Library	append_lines apply approx arccos arccosh arcsin
     66 syn keyword euphoria4Library 	arcsinh arctanh assert at atan2 atom_to_float32
     67 syn keyword euphoria4Library 	atom_to_float64 attr_to_colors avedev average
     68 syn keyword euphoria4Library 	begins binary_search bind binop_ok bits_to_int
     69 syn keyword euphoria4Library 	bk_color breakup build_commandline build_list
     70 syn keyword euphoria4Library 	bytes_to_int calc_hash calc_primes call_back
     71 syn keyword euphoria4Library 	canon2win canonical canonical_path ceil
     72 syn keyword euphoria4Library 	central_moment chance char_test chdir
     73 syn keyword euphoria4Library 	check_all_blocks check_break check_free_list
     74 syn keyword euphoria4Library 	checksum clear clear_directory cmd_parse
     75 syn keyword euphoria4Library 	colors_to_attr columnize combine connect
     76 syn keyword euphoria4Library 	console_colors copy copy_file cosh count crash
     77 syn keyword euphoria4Library 	crash_file crash_message crash_routine create
     78 syn keyword euphoria4Library 	create_directory create_file curdir current_dir
     79 syn keyword euphoria4Library	cursor custom_sort datetime days_in_month
     80 syn keyword euphoria4Library 	days_in_year db_cache_clear db_clear_table db_close
     81 syn keyword euphoria4Library	db_compress db_connect db_create db_create_table
     82 syn keyword euphoria4Library 	db_current db_current_table db_delete_record
     83 syn keyword euphoria4Library 	db_delete_table db_dump db_fetch_record db_find_key
     84 syn keyword euphoria4Library	db_get_errors db_get_recid db_insert db_open
     85 syn keyword euphoria4Library	db_record_data db_record_key db_record_recid
     86 syn keyword euphoria4Library 	db_rename_table db_replace_data db_replace_recid
     87 syn keyword euphoria4Library 	db_select db_select_table db_set_caching
     88 syn keyword euphoria4Library 	db_table_list db_table_size deallocate decanonical
     89 syn keyword euphoria4Library 	decode defaulted_value defaultext define_c_func
     90 syn keyword euphoria4Library 	define_c_proc define_c_var deg2rad delete_file
     91 syn keyword euphoria4Library 	dep_works dequote deserialize diff dir dir_size
     92 syn keyword euphoria4Library 	dirname disk_metrics disk_size display
     93 syn keyword euphoria4Library 	display_text_image dnsquery driveid dump dup emovavg
     94 syn keyword euphoria4Library 	encode ends ensure_in_list ensure_in_range
     95 syn keyword euphoria4Library 	error_code error_message error_no error_string
     96 syn keyword euphoria4Library 	error_to_string escape euphoria_copyright exec
     97 syn keyword euphoria4Library 	exp extract fetch fib file_exists file_length
     98 syn keyword euphoria4Library 	file_timestamp file_type filebase fileext filename
     99 syn keyword euphoria4Library	filter find_all find_all_but find_any find_each
    100 syn keyword euphoria4Library 	find_nested find_replace find_replace_callback
    101 syn keyword euphoria4Library	find_replace_limit flags_to_string flatten
    102 syn keyword euphoria4Library 	float32_to_atom float64_to_atom flush for_each
    103 syn keyword euphoria4Library 	format frac free free_code free_console free_low
    104 syn keyword euphoria4Library	free_pointer_array from_date from_unix gcd geomean
    105 syn keyword euphoria4Library	get get_bytes get_charsets get_def_lang
    106 syn keyword euphoria4Library 	get_display_page get_dstring get_encoding_properties
    107 syn keyword euphoria4Library 	get_integer16 get_integer32 get_lang_path get_lcid
    108 syn keyword euphoria4Library 	get_mouse get_option get_ovector_size get_pid
    109 syn keyword euphoria4Library 	get_position get_rand get_screen_char get_text
    110 syn keyword euphoria4Library 	get_vector getaddrinfo getmxrr getnsrr graphics_mode
    111 syn keyword euphoria4Library 	harmean has has_console has_match hex_text
    112 syn keyword euphoria4Library 	host_by_addr host_by_name http_get http_post iff
    113 syn keyword euphoria4Library 	iif info init_class init_curdir insertion_sort
    114 syn keyword euphoria4Library 	instance int_to_bits int_to_bytes intdiv
    115 syn keyword euphoria4Library 	is_DEP_supported is_empty is_even is_even_obj
    116 syn keyword euphoria4Library 	is_in_list is_in_range is_inetaddr is_leap_year
    117 syn keyword euphoria4Library 	is_match is_using_DEP is_win_nt join join_path
    118 syn keyword euphoria4Library 	keep_comments keep_newlines key_codes keys keyvalues
    119 syn keyword euphoria4Library	kill kurtosis lang_load larger_of largest last
    120 syn keyword euphoria4Library 	listen load load_map locate_file lock_file
    121 syn keyword euphoria4Library	lock_memory log10 lookup lower malloc mapping
    122 syn keyword euphoria4Library 	match_all match_any match_replace matches max
    123 syn keyword euphoria4Library 	maybe_any_key median memory_used merge message_box
    124 syn keyword euphoria4Library	mid min minsize mod mode money mouse_events
    125 syn keyword euphoria4Library	mouse_pointer movavg move_file nested_get
    126 syn keyword euphoria4Library 	nested_put new new_extra new_from_kvpairs
    127 syn keyword euphoria4Library 	new_from_string new_time next_prime now now_gmt
    128 syn keyword euphoria4Library 	number open_dll optimize option_spec_to_string
    129 syn keyword euphoria4Library 	or_all	pad_head pad_tail pairs parse
    130 syn keyword euphoria4Library 	parse_commandline parse_ip_address parse_querystring
    131 syn keyword euphoria4Library 	parse_url patch pathinfo pathname pcre_copyright
    132 syn keyword euphoria4Library 	peek_end peek_top peek_wstring pivot platform_name
    133 syn keyword euphoria4Library 	poke_string poke_wstring pop powof2 prepare_block
    134 syn keyword euphoria4Library 	pretty_print pretty_sprint prime_list process_lines
    135 syn keyword euphoria4Library 	product project prompt_number prompt_string proper
    136 syn keyword euphoria4Library 	push put put_integer16 put_integer32 put_screen_char
    137 syn keyword euphoria4Library 	quote rad2deg rand_range range raw_frequency read
    138 syn keyword euphoria4Library 	read_bitmap read_file read_lines receive receive_from
    139 syn keyword euphoria4Library	register_block rehash remove_all remove_directory
    140 syn keyword euphoria4Library 	remove_dups remove_item remove_subseq rename_file
    141 syn keyword euphoria4Library	repeat_pattern reset retain_all reverse rfind rmatch
    142 syn keyword euphoria4Library 	rnd rnd_1 roll rotate rotate_bits round safe_address
    143 syn keyword euphoria4Library 	sample save_bitmap save_map save_text_image scroll
    144 syn keyword euphoria4Library	seek select send send_to serialize series
    145 syn keyword euphoria4Library	service_by_name service_by_port set
    146 syn keyword euphoria4Library 	set_accumulate_summary set_charsets set_colors
    147 syn keyword euphoria4Library 	set_decimal_mark set_def_lang set_default_charsets
    148 syn keyword euphoria4Library 	set_encoding_properties set_keycodes set_lang_path
    149 syn keyword euphoria4Library 	set_option set_rand set_test_abort set_test_verbosity
    150 syn keyword euphoria4Library 	set_vector set_wait_on_summary setenv shift_bits
    151 syn keyword euphoria4Library 	show_block show_help show_tokens shuffle shutdown
    152 syn keyword euphoria4Library 	sign sim_index sinh size skewness sleep slice small
    153 syn keyword euphoria4Library 	smaller_of smallest sort sort_columns sound split
    154 syn keyword euphoria4Library 	split_any split_limit split_path sprint start_time
    155 syn keyword euphoria4Library 	statistics stdev store string_numbers subtract sum
    156 syn keyword euphoria4Library 	sum_central_moments swap tanh task_delay temp_file
    157 syn keyword euphoria4Library 	test_equal test_exec test_fail test_false
    158 syn keyword euphoria4Library 	test_not_equal test_pass test_read test_report
    159 syn keyword euphoria4Library	test_true test_write text_color text_rows threshold
    160 syn keyword euphoria4Library 	tick_rate to_integer to_number to_string to_unix
    161 syn keyword euphoria4Library	tokenize_file tokenize_string top transform translate
    162 syn keyword euphoria4Library 	transmute trim trim_head trim_tail trsprintf trunc
    163 syn keyword euphoria4Library 	type_of uname unlock_file unregister_block unsetenv
    164 syn keyword euphoria4Library	upper use_vesa valid valid_index value values version
    165 syn keyword euphoria4Library	version_date version_major version_minor version_node
    166 syn keyword euphoria4Library 	version_patch version_revision version_string
    167 syn keyword euphoria4Library 	version_string_long version_string_short version_type
    168 syn keyword euphoria4Library 	video_config vlookup vslice wait_key walk_dir
    169 syn keyword euphoria4Library 	warning_file weeks_day where which_bit wildcard_file
    170 syn keyword euphoria4Library 	wildcard_match wrap write write_file write_lines
    171 syn keyword euphoria4Library 	writef writefln years_day
    172 
    173 " Library Identifiers (Type) - grep from $EUDIR/include/*:
    174 syn keyword euphoria4Type	ascii_string boolean bordered_address byte_range
    175 syn keyword euphoria4Type	case_flagset_type color cstring 
    176 syn keyword euphoria4Type	file_number file_position graphics_point
    177 syn keyword euphoria4Type	integer_array lcid lock_type machine_addr map 
    178 syn keyword euphoria4Type	mixture number_array option_spec
    179 syn keyword euphoria4Type	page_aligned_address positive_int process regex
    180 syn keyword euphoria4Type	sequence_array socket stack std_library_address
    181 syn keyword euphoria4Type	string t_alnum t_alpha t_ascii t_boolean
    182 syn keyword euphoria4Type	t_bytearray t_cntrl t_consonant t_digit t_display
    183 syn keyword euphoria4Type	t_graph t_identifier t_lower t_print t_punct
    184 syn keyword euphoria4Type	t_space t_specword t_text t_upper t_vowel t_xdigit
    185 syn keyword euphoria4Type	valid_memory_protection_constant valid_wordsize
    186 
    187 " Linux shell comment (#!...):
    188 syn match   euphoria4Comment	"\%^#!.*$"
    189 " Single and multilines comments: 
    190 syn region  euphoria4Comment 	start=/--/ end=/$/ 
    191 syn region  euphoria4Comment 	start="/\*" end="\*/" 
    192 
    193 " Delimiters and brackets:
    194 syn match   euphoria4Delimit	"[([\])]"
    195 syn match   euphoria4Delimit	"\.\."
    196 syn match   euphoria4Delimit	":"
    197 syn match   euphoria4Operator	"[{}]"
    198 
    199 " Character constant:
    200 syn region  euphoria4Char	start=/'/ skip=/\\'\|\\\\/ end=/'/ oneline
    201 
    202 " String constant (""" must be *after* "): 
    203 syn region  euphoria4String	start=/"/ skip=/\\"\|\\\\/ end=/"/ oneline 
    204 syn region  euphoria4String	start=/b"\|x"/ end=/"/ 
    205 syn region  euphoria4String	start=/`/ end=/`/
    206 syn region  euphoria4String	start=/"""/ end=/"""/
    207 
    208 " Binary/Octal/Decimal/Hexadecimal integer:
    209 syn match   euphoria4Number 	"\<0b[01_]\+\>"
    210 syn match   euphoria4Number 	"\<0t[0-7_]\+\>"
    211 syn match   euphoria4Number 	"\<0d[0-9_]\+\>"
    212 syn match   euphoria4Number 	"\<0x[0-9A-Fa-f_]\+\>"
    213 syn match   euphoria4Number 	"#[0-9A-Fa-f_]\+\>"
    214 
    215 " Integer/Floating point without a dot:
    216 syn match   euphoria4Number	"\<\d\+\>"
    217 " Floating point with dot:
    218 syn match   euphoria4Number	"\<\d\+\.\d*\>"
    219 " Floating point starting with a dot:
    220 syn match   euphoria4Number	"\.\d\+\>"
    221 " Boolean constants: 
    222 syn keyword euphoria4Boolean	true TRUE false FALSE
    223 
    224 " Define the default highlighting.
    225 " Only used when an item doesn't have highlighting yet:
    226 hi def link euphoria4Comment	Comment
    227 hi def link euphoria4String	String
    228 hi def link euphoria4Char	Character
    229 hi def link euphoria4Number	Number	
    230 hi def link euphoria4Boolean	Boolean	
    231 hi def link euphoria4Builtin	Identifier	
    232 hi def link euphoria4Library 	Function	
    233 hi def link euphoria4Type 	Type	
    234 hi def link euphoria4Keyword	Statement	
    235 hi def link euphoria4Operator	Statement		
    236 hi def link euphoria4Debug	Debug	
    237 hi def link euphoria4Delimit	Delimiter	
    238 hi def link euphoria4PreProc	PreProc	
    239 
    240 let b:current_syntax = "euphoria4"
    241 
    242 " Restore current compatible-options: 
    243 let &cpo = s:save_cpo
    244 unlet s:save_cpo