1" Vim syntax file 2" Language: Euphoria 3.1.1 - supports DOS - (http://www.rapideuphoria.com/) 3" Maintainer: Shian Lee 4" Last Change: 2014 Feb 24 (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 9if exists("b:current_syntax") 10 finish 11endif 12 13" Reset compatible-options to Vim default value, just in case: 14let s:save_cpo = &cpo 15set cpo&vim 16 17" Should suffice for very long expressions: 18syn sync lines=40 19 20" Euphoria is a case-sensitive language (with only 4 builtin types): 21syntax case match 22 23" Keywords/Builtins for Debug - from $EUDIR/bin/keywords.e: 24syn keyword euphoria3Debug with without trace profile 25syn keyword euphoria3Debug profile_time warning type_check 26 27" Keywords (Statments) - from $EUDIR/bin/keywords.e: 28syn keyword euphoria3Keyword if end then procedure else for return 29syn keyword euphoria3Keyword do elsif while type constant to and or 30syn keyword euphoria3Keyword exit function global by not include 31syn keyword euphoria3Keyword xor 32 33" Builtins (Identifiers) - from $EUDIR/bin/keywords.e: 34syn keyword euphoria3Builtin length puts integer sequence position object 35syn keyword euphoria3Builtin append prepend print printf 36syn keyword euphoria3Builtin clear_screen floor getc gets get_key 37syn keyword euphoria3Builtin rand repeat atom compare find match 38syn keyword euphoria3Builtin time command_line open close getenv 39syn keyword euphoria3Builtin sqrt sin cos tan log system date remainder 40syn keyword euphoria3Builtin power machine_func machine_proc abort peek poke 41syn keyword euphoria3Builtin call sprintf arctan and_bits or_bits xor_bits 42syn keyword euphoria3Builtin not_bits pixel get_pixel mem_copy mem_set 43syn keyword euphoria3Builtin c_proc c_func routine_id call_proc call_func 44syn keyword euphoria3Builtin poke4 peek4s peek4u equal system_exec 45syn keyword euphoria3Builtin platform task_create task_schedule task_yield 46syn keyword euphoria3Builtin task_self task_suspend task_list 47syn keyword euphoria3Builtin task_status task_clock_stop task_clock_start 48syn keyword euphoria3Builtin find_from match_from 49" Builtins (Identifiers) shortcuts for length() and print(): 50syn match euphoria3Builtin "\$" 51syn match euphoria3Builtin "?" 52 53" Library Identifiers (Function) - from $EUDIR/doc/library.doc: 54syn keyword euphoria3Library reverse sort custom_sort lower upper 55syn keyword euphoria3Library wildcard_match wildcard_file arcsin 56syn keyword euphoria3Library arccos PI flush lock_file unlock_file 57syn keyword euphoria3Library pretty_print sprint get_bytes prompt_string 58syn keyword euphoria3Library wait_key get prompt_number value seek where 59syn keyword euphoria3Library current_dir chdir dir walk_dir allow_break 60syn keyword euphoria3Library check_break get_mouse mouse_events mouse_pointer 61syn keyword euphoria3Library tick_rate sleep get_position graphics_mode 62syn keyword euphoria3Library video_config scroll wrap text_color bk_color 63syn keyword euphoria3Library palette all_palette get_all_palette read_bitmap 64syn keyword euphoria3Library save_bitmap get_active_page set_active_page 65syn keyword euphoria3Library get_display_page set_display_page sound 66syn keyword euphoria3Library cursor text_rows get_screen_char put_screen_char 67syn keyword euphoria3Library save_text_image display_text_image draw_line 68syn keyword euphoria3Library polygon ellipse save_screen save_image display_image 69syn keyword euphoria3Library dos_interrupt allocate free allocate_low free_low 70syn keyword euphoria3Library allocate_string register_block unregister_block 71syn keyword euphoria3Library get_vector set_vector lock_memory int_to_bytes 72syn keyword euphoria3Library bytes_to_int int_to_bits bits_to_int atom_to_float64 73syn keyword euphoria3Library atom_to_float32 float64_to_atom float32_to_atom 74syn keyword euphoria3Library set_rand use_vesa crash_file crash_message 75syn keyword euphoria3Library crash_routine open_dll define_c_proc define_c_func 76syn keyword euphoria3Library define_c_var call_back message_box free_console 77syn keyword euphoria3Library instance 78 79" Library Identifiers (Function) - from $EUDIR/doc/database.doc: 80syn keyword euphoria3Library db_create db_open db_select db_close db_create_table 81syn keyword euphoria3Library db_select_table db_rename_table db_delete_table 82syn keyword euphoria3Library db_table_list db_table_size db_find_key db_record_key 83syn keyword euphoria3Library db_record_data db_insert db_delete_record 84syn keyword euphoria3Library db_replace_data db_compress db_dump db_fatal_id 85 86" Linux shell comment (#!...): 87syn match euphoria3Comment "\%^#!.*$" 88" Comment on one line: 89syn region euphoria3Comment start=/--/ end=/$/ 90 91" Delimiters and brackets: 92syn match euphoria3Delimit "[([\])]" 93syn match euphoria3Delimit "\.\." 94syn match euphoria3Operator "[{}]" 95 96" Character constant: 97syn region euphoria3Char start=/'/ skip=/\\'\|\\\\/ end=/'/ oneline 98 99" String constant: 100syn region euphoria3String start=/"/ skip=/\\"\|\\\\/ end=/"/ oneline 101 102" Hexadecimal integer: 103syn match euphoria3Number "#[0-9A-F]\+\>" 104 105" Integer/Floating point without a dot: 106syn match euphoria3Number "\<\d\+\>" 107" Floating point with dot: 108syn match euphoria3Number "\<\d\+\.\d*\>" 109" Floating point starting with a dot: 110syn match euphoria3Number "\.\d\+\>" 111" Boolean constants: 112syn keyword euphoria3Boolean true TRUE false FALSE 113 114" Define the default highlighting. 115" Only used when an item doesn't have highlighting yet: 116hi def link euphoria3Comment Comment 117hi def link euphoria3String String 118hi def link euphoria3Char Character 119hi def link euphoria3Number Number 120hi def link euphoria3Boolean Boolean 121hi def link euphoria3Builtin Identifier 122hi def link euphoria3Library Function 123hi def link euphoria3Keyword Statement 124hi def link euphoria3Operator Statement 125hi def link euphoria3Debug Debug 126hi def link euphoria3Delimit Delimiter 127 128let b:current_syntax = "euphoria3" 129 130" Restore current compatible-options: 131let &cpo = s:save_cpo 132unlet s:save_cpo 133 134