Skip to content

Commit

Permalink
Highlight multiret (#324)
Browse files Browse the repository at this point in the history
* Highlight function declaration with multiple returning values

* Updatetd list of builtins to highlight

* Fix highlight when return single-sym type
  • Loading branch information
inferrna authored Aug 19, 2024
1 parent 70d538d commit a7b921a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dev/vscode-ext/syntaxes/lobster.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
{
"name": "support.function.source.lobster",
"match": "\\b(print|string|set_print_depth|set_print_length|set_print_quoted|set_print_decimals|set_print_indent|get_line|append|vector_reserve|length|length|length|equal|push|pop|top|insert|remove|remove_obj|binary_search|binary_search|binary_search|copy|slice|any|any|all|all|substring|string_to_int|string_to_float|tokenize|unicode_to_string|string_to_unicode|number_to_string|lowercase|uppercase|escape_string|concat_string|repeat_string|pow|pow|pow|log|sqrt|ceiling|ceiling|floor|floor|int|int|round|round|fraction|fraction|float|float|sin|cos|tan|sincos|asin|acos|atan|radians|degrees|atan2|radians|degrees|normalize|dot|magnitude|manhattan|cross|rnd|rnd|rnd_float|rnd_gaussian|rnd_seed|div|clamp|clamp|clamp|clamp|in_range|in_range|in_range|abs|abs|abs|abs|sign|sign|sign|sign|min|min|min|min|min|min|min|min|max|max|max|max|max|max|max|max|lerp|lerp|cardinal_spline|line_intersect|circles_within_range|wave_function_collapse|resume|return_value|active|hash|hash|program_name|vm_compiled_mode|seconds_elapsed|assert|trace_bytecode|set_max_stack_size|reference_count|set_console|command_line_arguments|thread_information|is_worker_thread|start_worker_threads|stop_worker_threads|workers_alive|thread_write|thread_read|compile_run_code|compile_run_file|scan_folder|read_file|write_file|ensure_size|write_int64_le|write_int32_le|write_int16_le|write_int8_le|write_float64_le|write_float32_le|write_int64_le_back|write_int32_le_back|write_int16_le_back|write_int8_le_back|write_float64_le_back|write_float32_le_back|write_substring|write_substring_back|compare_substring|read_int64_le|read_int32_le|read_int16_le|read_int8_le|read_float64_le|read_float32_le|read_int64_le_back|read_int32_le_back|read_int16_le_back|read_int8_le_back|read_float64_le_back|read_float32_le_back|flatbuffers_field_int64|flatbuffers_field_int32|flatbuffers_field_int16|flatbuffers_field_int8|flatbuffers_field_float64|flatbuffers_field_float32|flatbuffers_field_string|flatbuffers_field_vector_len|flatbuffers_field_vector|flatbuffers_field_table|flatbuffers_field_struct|flatbuffers_indirect|flatbuffers_string|flatbuffers_binary_to_json|flatbuffers_json_to_binary|parse_data|gl_window|gl_require_version|gl_load_materials|gl_frame|gl_log_frame|gl_shutdown|gl_window_title|gl_window_min_max|gl_visible|gl_cursor|gl_grab|gl_button|gl_touchscreen|gl_dpi|gl_window_size|gl_mouse_pos|gl_mouse_delta|gl_local_mouse_pos|gl_last_pos|gl_local_last_pos|gl_mousewheel_delta|gl_joy_axis|gl_delta_time|gl_time|gl_last_time|gl_clear|gl_color|gl_polygon|gl_circle|gl_open_circle|gl_unit_cube|gl_rotate_x|gl_rotate_y|gl_rotate_z|gl_translate|gl_scale|gl_scale|gl_origin|gl_scaling|gl_model_view_projection|gl_point_scale|gl_line_mode|gl_hit|gl_rect|gl_rect_tc_col|gl_unit_square|gl_line|gl_perspective|gl_ortho|gl_ortho3d|gl_new_poly|gl_new_mesh|gl_new_mesh_iqm|gl_mesh_parts|gl_mesh_size|gl_animate_mesh|gl_render_mesh|gl_save_mesh|gl_set_shader|gl_set_uniform|gl_set_uniform|gl_set_uniform_array|gl_set_uniform_matrix|gl_uniform_buffer_object|gl_uniform_buffer_object|gl_delete_buffer_object|gl_bind_mesh_to_compute|gl_dispatch_compute|gl_dump_shader|gl_blend|gl_load_texture|gl_set_primitive_texture|gl_set_mesh_texture|gl_set_image_texture|gl_create_texture|gl_create_blank_texture|gl_texture_size|gl_read_texture|gl_switch_to_framebuffer|gl_light|gl_render_tiles|gl_debug_grid|gl_screenshot|gl_set_font_name|gl_set_font_size|gl_set_max_font_size|gl_get_font_size|gl_get_outline_size|gl_text|gl_text_size|gl_get_glyph_name|gl_get_char_code|play_wav|play_sfxr|ph_initialize|ph_create_box|ph_create_circle|ph_create_polygon|ph_dynamic|ph_set_color|ph_set_shader|ph_set_texture|ph_get_position|ph_create_particle|ph_create_particle_circle|ph_initialize_particles|ph_step|ph_particle_contacts|ph_raycast|ph_delete_particle|ph_getparticle_position|ph_render|ph_render_particles|simplex|mg_sphere|mg_cube|mg_cylinder|mg_tapered_cylinder|mg_superquadric|mg_superquadric_non_uniform|mg_supertoroid|mg_landscape|mg_set_polygon_reduction|mg_set_color_noise|mg_set_vertex_randomize|mg_set_point_mode|mg_polygonize|mg_translate|mg_scale|mg_scale_vec|mg_rotate|mg_color|mg_smooth|cg_init|cg_size|cg_set|cg_copy|cg_color_to_palette|cg_palette_to_color|cg_copy_palette|cg_resample_half|cg_create_mesh|cg_create_3d_texture|cg_load_vox|cg_save_vox|cg_get_buf|cg_average_surface_color|cg_rotate|oc_world_bits|oc_buf|oc_load|oc_save|oc_new|oc_set|oc_get|vr_init|vr_start_eye|vr_start|vr_finish|vr_set_eye_texture|vr_num_motion_controllers|vr_motioncontrollerstracking|vr_motion_controller|vr_create_motion_controller_mesh|vr_motion_controller_button|vr_motion_controller_vec|vr_hmd_vec|steam_init|steam_overlay|steam_username|steam_unlock_achievement|steam_write_file|steam_read_file|im_init|im_add_font|im_frame|im_window_demo|im_window|im_button|im_same_line|im_separator|im_text|im_tooltip|im_checkbox|im_input_text|im_radio|im_combo|im_listbox|im_sliderint|im_sliderfloat|im_coloredit|im_treenode|im_group|im_edit_anything|im_graph|im_show_vars|im_show_engine_stats)\\b"
"match": "\\b(abs|acos|all|any|append|append_into|asin|assert|atan|atan2|binary_search|binary_search_first_field_object|binary_search_first_field_string|binary_search_object|breakpoint|call_function_value|cardinal_spline|ceiling|cg.average_face_colors|cg.average_surface_color|cg.bounding_box|cg.chunks_skipped|cg.clone|cg.color_to_palette|cg.copy|cg.create_3d_texture|cg.create_mesh|cg.erode|cg.get|cg.get_buf|cg.get_palette|cg.get_palette_storage_buf|cg.get_palette_storage_len|cg.init|cg.load_image|cg.load_palette|cg.load_vox|cg.load_vox_names|cg.name|cg.normal_indices|cg.num_solid|cg.offset|cg.palette_storage_index|cg.palette_to_color|cg.randomize|cg.rotate|cg.sample_down|cg.save_vox|cg.scale_up|cg.set|cg.set_palette|cg.simplex|cg.size|cg.stretch|circles_within_range|clamp|command_line_arguments|compare_substring|compile_run_code|compile_run_file|concat_string|copy|cos|crash_test_cpp_nullptr_exception|cross|date_time|date_time_build_info|date_time_string|date_time_string_format|deepcopy|degrees|delete_file|div|dot|ensure_size|equal|escape_string|exists_file|find_string|find_string_reverse|flatbuffers.binary_to_json|flatbuffers.field_float32|flatbuffers.field_float64|flatbuffers.field_int16|flatbuffers.field_int32|flatbuffers.field_int64|flatbuffers.field_int8|flatbuffers.field_present|flatbuffers.field_string|flatbuffers.field_struct|flatbuffers.field_table|flatbuffers.field_uint16|flatbuffers.field_uint32|flatbuffers.field_uint64|flatbuffers.field_uint8|flatbuffers.field_vector|flatbuffers.field_vector_len|flatbuffers.indirect|flatbuffers.json_to_binary|flatbuffers.string|flexbuffers_binary_to_json|flexbuffers_binary_to_value|flexbuffers_json_to_binary|flexbuffers_value_to_binary|float|floor|fraction|get_line|get_memory_usage|get_stack_trace|gl.animate_mesh|gl.animate_mesh_blend|gl.bind_buffer_object|gl.bind_mesh_to_compute|gl.blend|gl.button|gl.circle|gl.clear|gl.color|gl.controller_axis|gl.copy_buffer_object|gl.create_blank_texture|gl.create_colored_texture|gl.create_texture|gl.create_texture_single_channel|gl.create_time_query|gl.cull_front|gl.cursor|gl.debug_grid|gl.delta_time|gl.delta_time_rolling|gl.dispatch_compute|gl.dpi|gl.dropped_file|gl.dump_shader|gl.end_text_input|gl.frame|gl.framebuffer_size|gl.fullscreen|gl.generate_texture_mipmap|gl.get_char_code|gl.get_font_size|gl.get_glyph_name|gl.get_outline_size|gl.get_shader|gl.grab|gl.hit|gl.init_controller_database|gl.joy_axis|gl.key_repeat|gl.last_pos|gl.last_time|gl.light|gl.line|gl.line_mode|gl.load_materials|gl.load_texture|gl.local_last_pos|gl.local_mouse_pos|gl.mesh_animation_frames|gl.mesh_animations|gl.mesh_parts|gl.mesh_pointsize|gl.mesh_size|gl.model_view|gl.model_view_projection|gl.mouse_delta|gl.mouse_pos|gl.mousewheel_delta|gl.new_mesh|gl.new_mesh_iqm|gl.new_poly|gl.open_circle|gl.open_url|gl.origin|gl.ortho|gl.ortho3d|gl.perspective|gl.point_scale|gl.polygon|gl.pop_model_view|gl.projection|gl.push_model_view|gl.read_texture|gl.rect|gl.rect_tc_col|gl.render_mesh|gl.render_tiles|gl.require_version|gl.rotate_x|gl.rotate_y|gl.rotate_z|gl.rounded_rectangle|gl.save_mesh|gl.save_texture|gl.scale|gl.scaling|gl.scissor|gl.screenshot|gl.set_font_name|gl.set_font_size|gl.set_image_texture|gl.set_max_font_size|gl.set_mesh_texture|gl.set_primitive_texture|gl.set_shader|gl.set_text_input|gl.set_texture_flags|gl.set_uniform|gl.set_uniform_array|gl.set_uniform_matrix|gl.shutdown|gl.start_text_input|gl.start_time_query|gl.stop_time_query|gl.switch_to_framebuffer|gl.text|gl.text_input_state|gl.text_size|gl.texture_size|gl.time|gl.touchscreen|gl.translate|gl.unbind_all_textures|gl.unit_cube|gl.unit_square|gl.update_buffer_object|gl.visible|gl.window|gl.window_min_max|gl.window_size|gl.window_title|hash|im.accept_drag_drop_payload|im.add_font|im.button|im.button_repeat_end|im.button_repeat_start|im.calc_text_size|im.checkbox|im.child_end|im.child_start|im.close_current_popup|im.coloredit|im.color_end|im.color_start|im.combo|im.disabled_end|im.disabled_start|im.dockspace_over_viewport|im.drag_drop_source_end|im.drag_drop_source_start|im.drag_drop_target_end|im.drag_drop_target_start|im.edit_anything|im.font_end|im.font_start|im.frame_end|im.frame_start|im.get_content_region_avail|im.get_layout_pos|im.graph|im.group_end|im.group_start|im.id_end|im.id_start|im.image|im.image_button|im.image_mouseclick|im.init|im.input_float|im.input_int|im.input_text|im.input_text_multi_line|im.is_item_deactivated_after_edit|im.listbox|im.menu_bar_end|im.menu_bar_start|im.menu_end|im.menu_item|im.menu_item_toggle|im.menu_start|im.mouse_clicked|im.new_line|im.next_window_pos|im.next_window_size|im.popup_end|im.popup_open|im.popup_start|im.progress_bar|im.radio|im.same_line|im.selectable|im.separator|im.set_drag_drop_payload|im.set_layout_pos|im.set_style_color|im.set_style_frame_padding|im.set_style_inner_spacing|im.set_style_spacing|im.set_style_window_padding|im.show_debug_metrics_window|im.show_engine_stats|im.show_flexbuffer|im.show_vars|im.sliderfloat|im.sliderfloat2|im.sliderfloat3|im.sliderfloat4|im.sliderint|im.sliderint2|im.sliderint3|im.sliderint4|im.tab_bar_end|im.tab_bar_start|im.tab_end|im.table_end|im.table_headers_row|im.table_next_column|im.table_next_row|im.table_setup_column|im.table_start|im.tab_start|im.text|im.text_table|im.text_wrapped|im.tooltip|im.tooltip_multi_end|im.tooltip_multi_start|im.treenode_end|im.treenode_start|im.width_end|im.width_start|im.window_demo|im.window_end|im.window_start|in_range|insert|int|is_worker_thread|launch_subprocess|length|lerp|line_intersect|load_ogg|load_sfxr|load_wav|lobster_binary_to_value|lobster_value_to_binary|log|log2|lowercase|magnitude|magnitude_squared|manhattan|matrix.multiply|matrix.rotate_x|matrix.rotate_y|matrix.rotate_z|matrix.translation|max|mg.color|mg.convert_to_cubes|mg.cube|mg.cylinder|mg.landscape|mg.polygonize|mg.pop_transform|mg.push_transform|mg.rotate|mg.scale|mg.scale_vec|mg.set_color_noise|mg.set_point_mode|mg.set_polygon_reduction|mg.set_vertex_randomize|mg.smooth|mg.sphere|mg.superquadric|mg.superquadric_non_uniform|mg.supertoroid|mg.tapered_cylinder|mg.translate|min|music_fade_out|music_halt|music_is_playing|music_pause|music_resume|music_set_general_volume|music_volume|normalize|number_to_string|parse_data|pass|ph.apply_linear_impulse_to_center|ph.create_box|ph.create_circle|ph.create_particle|ph.create_particle_circle|ph.create_polygon|ph.delete_particle|ph.dynamic|ph.get_mass|ph.getparticle_position|ph.get_position|ph.initialize|ph.initialize_particles|ph.particle_contacts|ph.raycast|ph.render|ph.render_particles|ph.set_color|ph.set_linear_velocity|ph.set_shader|ph.set_texture|ph.step|play_music|play_music_cross_fade|play_music_fade_in|play_ogg|play_sfxr|play_wav|pop|popcount|pow|print|program_name|push|radians|read_file|read_float32_le|read_float32_le_back|read_float64_le|read_float64_le_back|read_int16_le|read_int16_le_back|read_int32_le|read_int32_le_back|read_int64_le|read_int64_le_back|read_int8_le|read_int8_le_back|read_uint16_le|read_uint16_le_back|read_uint32_le|read_uint32_le_back|read_uint64_le|read_uint64_le_back|read_uint8_le|read_uint8_le_back|reference_count|remove|remove_obj|remove_range|rename_file|repeat_string|replace_string|rnd|rnd_float|rnd_gaussian|rndm|rndm_seed|rnd_seed|round|scan_folder|seconds_elapsed|set_console|set_exit_code|set_output_level|set_print_decimals|set_print_depth|set_print_indent|set_print_length|set_print_quoted|sign|simplex|simplex_raw|sin|sincos|slice|smootherstep|smoothmin|smoothstep|sound_halt|sound_pause|sound_position|sound_resume|sound_status|sound_time_length|sound_volume|spherical_lerp|sqrt|start_worker_threads|steam.friend_get_username|steam.get_steam_id|steam.init|steam.lobby_create|steam.lobby_delete_data|steam.lobby_get_all_data|steam.lobby_get_all_joined|steam.lobby_get_created|steam.lobby_get_data|steam.lobby_get_game_server|steam.lobby_get_joined|steam.lobby_get_members|steam.lobby_get_num_members|steam.lobby_join|steam.lobby_leave|steam.lobby_request_add_numerical_filter|steam.lobby_request_add_result_count_filter|steam.lobby_request_add_string_filter|steam.lobby_request_data|steam.lobby_request_get_lobbies|steam.lobby_request_is_ready|steam.lobby_request_list|steam.lobby_request_list_reset|steam.lobby_set_data|steam.lobby_set_game_server|steam.lobby_set_joinable|steam.net_identity|steam.net_identity_from_steam_id|steam.overlay|steam.p2p_broadcast_message|steam.p2p_close_connection|steam.p2p_close_listen|steam.p2p_connect|steam.p2p_get_connections|steam.p2p_get_connection_status|steam.p2p_listen|steam.p2p_receive_messages|steam.p2p_send_message|steam.p2p_set_recv_buffer_size|steam.p2p_set_send_buffer_size|steam.read_file|steam.shutdown|steam.unlock_achievement|steam.update|steam.username|steam.write_file|stop_worker_threads|string|string_to_float|string_to_int|string_to_unicode|substring|tan|text_to_speech|text_to_speech_stop|thread_check|thread_information|thread_read|thread_write|tokenize|top|trace_bytecode|type_element_string|type_field_count|type_field_name|type_field_string|type_field_value|type_id|type_string|unicode_to_string|uppercase|vector_capacity|vector_to_buffer|vm_compiled_mode|volume|vr.create_motion_controller_mesh|vr.finish|vr.hmd_vec|vr.init|vr.motion_controller|vr.motion_controller_button|vr.motioncontrollerstracking|vr.motion_controller_vec|vr.num_motion_controllers|vr.set_eye_texture|vr.start|vr.start_eye|wave_function_collapse|workers_alive|write_file|write_float32_le|write_float32_le_back|write_float64_le|write_float64_le_back|write_int16_le|write_int16_le_back|write_int32_le|write_int32_le_back|write_int64_le|write_int64_le_back|write_int8_le|write_int8_le_back|write_substring|write_substring_back)\\b"
},
{
"name": "keyword.control.source.lobster",
Expand Down Expand Up @@ -106,7 +106,7 @@
},
{
"name": "support.function.definition.lobster",
"begin": "\\b(def)\\s+([A-Za-z_][A-Za-z0-9_]*)(\\()",
"begin": "\\b(def|constructor)\\s+([A-Za-z_][A-Za-z0-9_]*)(\\()",
"beginCaptures": {
"1": {
"name": "keyword.control.lobster"
Expand All @@ -118,7 +118,7 @@
"name": "punctuation.definition.parameters.begin.lobster"
}
},
"end": "\\)(?:\\s*->\\s*)?([A-Za-z_][A-Za-z0-9_]*)?:",
"end": "\\)(?:\\s*->\\s*)?([A-Za-z_][A-Za-z0-9_, ]*[A-Za-z_]*)?:",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.lobster"
Expand Down Expand Up @@ -237,4 +237,4 @@
},
"scopeName": "source.lobster",
"uuid": "663fc343-f01e-4725-8095-d24d49e45079"
}
}

0 comments on commit a7b921a

Please sign in to comment.