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