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