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