@@ -52,6 +52,7 @@ impl LanguageSnippets {
5252 "scala" => Self :: scala ( ) ,
5353 "c++" | "cpp" => Self :: cpp ( ) ,
5454 "sql" => Self :: sql ( ) ,
55+ "lua" => Self :: lua ( ) ,
5556 _ => Self :: generic ( & lang) ,
5657 }
5758 }
@@ -270,6 +271,27 @@ xcpp::display(h);"#,
270271 }
271272 }
272273
274+ fn lua ( ) -> Self {
275+ // Lua scripting language
276+ Self {
277+ language : "lua" . to_string ( ) ,
278+ print_hello : "print('hello')" ,
279+ print_stderr : "io.stderr:write('error\\ n')" ,
280+ simple_expr : "return 1 + 1" ,
281+ simple_expr_result : "2" ,
282+ incomplete_code : "function foo(" ,
283+ complete_code : "x = 1" ,
284+ syntax_error : "function function" ,
285+ input_prompt : "-- Lua stdin varies by kernel" ,
286+ sleep_code : "-- Lua sleep requires os.execute or socket" ,
287+ completion_var : "test_variable_for_completion" ,
288+ completion_setup : "test_variable_for_completion = 42" ,
289+ completion_prefix : "test_variable_for_" ,
290+ display_data_code : "print('no rich display')" ,
291+ update_display_data_code : "-- Lua doesn't support update_display_data" ,
292+ }
293+ }
294+
273295 /// Generic fallback for unknown languages
274296 fn generic ( language : & str ) -> Self {
275297 Self {
0 commit comments