From 4665146db73a14ef6c5f4ee620ac581689860df8 Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 09:16:37 +0900 Subject: Julia Syntax Updated --- plugins/language_julia.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index 65bc1ce..cc4699a 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -1,5 +1,5 @@ -- mod-version:2 -- lite-xl 2.0 --- Support for the Julia programming language: +-- Support for the Julia programming language: -- Covers the most used keywords up to Julia version 1.6.4 local syntax = require "core.syntax" @@ -9,8 +9,9 @@ syntax.add { files = { "%.jl$" }, comment = "#", patterns = { - { pattern = { "#=", "=#" }, type = "comment" }, + { pattern = { "#=", "=#" }, type = "comment" }, { pattern = "#.-\n", type = "comment" }, + { pattern = { '[ruU]?"""', '"""'; '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "`", "`", '\\' }, type = "string" }, { pattern = "0[oO_][0-7]+", type = "number" }, @@ -18,13 +19,15 @@ syntax.add { { pattern = "-?%d+_%d", type = "number" }, { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, { pattern = "-?%.?%d+f?", type = "number" }, - { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, + { pattern = "[%+%-=/%*%^%%<>!~|&]%:", type = "operator"}, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = {"@"," "}, type = "operator" }, + { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, + { pattern = { "{", "}"}, type = "string"}, { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { -- keywords - ["abstract type"] = "keyword", ["baremodule"] = "keyword", ["begin"] = "keyword", ["break`"] = "keyword", @@ -44,6 +47,7 @@ syntax.add { ["function"] = "keyword", ["global"] = "keyword", ["if"] = "keyword", + ["in"] = "keyword", ["import"] = "keyword", ["let"] = "keyword", ["local"] = "keyword", @@ -55,9 +59,11 @@ syntax.add { ["typeof"] = "keyword", ["using"] = "keyword", ["while"] = "keyword", - + -- types ["struct"] = "keyword2", + ["abstract type"] = "keyword2", + ["primitive type"] = "keyword2", ["mutable struct"] = "keyword2", ["Char"] = "keyword2", ["Bool"] = "keyword2", @@ -77,6 +83,8 @@ syntax.add { ["Float64"] = "keyword2", ["Vector"] = "keyword2", ["Matrix"] = "keyword2", + ["Ref"] = "keyword2", + ["String"] = "keyword2", -- literals ["missing"] = "literal", -- cgit v1.2.3 From 70cf94a9fb0689634929fe0c2233377903d8402a Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 09:26:13 +0900 Subject: Minor fix --- plugins/language_julia.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index cc4699a..1ae541e 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -19,7 +19,7 @@ syntax.add { { pattern = "-?%d+_%d", type = "number" }, { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, { pattern = "-?%.?%d+f?", type = "number" }, - { pattern = "[%+%-=/%*%^%%<>!~|&]%:", type = "operator"}, + { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator"}, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, { pattern = {"@"," "}, type = "operator" }, { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, -- cgit v1.2.3 From d57c13ae29f9b5b5a6baec1ce3792c1123b644f2 Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 09:37:14 +0900 Subject: Minor bug fix --- me.jl | 144 +++++++++++++++++++++++++++++++++++++++++++++ plugins/language_julia.lua | 2 +- 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 me.jl diff --git a/me.jl b/me.jl new file mode 100644 index 0000000..20dc224 --- /dev/null +++ b/me.jl @@ -0,0 +1,144 @@ +# Handers for execute_request and related messages, which are +# the core of the Jupyter protocol: execution of Julia code and +# returning results. + +import Base.Libc: flush_cstdio +import Pkg + +# global variable so that display can be done in the correct Msg context +execute_msg = Msg(["julia"], Dict("username"=>"jlkernel", "session"=>uuid4()), Dict()) +# global variable tracking the number of bytes written in the current execution +# request +const stdio_bytes = Ref(0) + +import REPL: helpmode + +# use a global array to accumulate "payloads" for the execute_reply message +const execute_payloads = Dict[] + +function execute_request(socket, msg) + code = msg.content["code"] + @vprintln("EXECUTING", code) + global execute_msg = msg + global n, In, Out, ans + stdio_bytes[] = 0 + silent = msg.content["silent"] + store_history = get(msg.content, "store_history", !silent) + empty!(execute_payloads) + + if !silent + n += 1 + send_ipython(publish[], + msg_pub(msg, "execute_input", + Dict("execution_count" => n, + "code" => code))) + end + + silent = silent || REPL.ends_with_semicolon(code) + if store_history + In[n] = code + end + + # "; ..." cells are interpreted as shell commands for run + code = replace(code, r"^\s*;.*$" => + m -> string(replace(m, r"^\s*;" => "Base.repl_cmd(`"), + "`, stdout)")) + + + # "] ..." cells are interpreted as pkg shell commands + if occursin(r"^\].*$", code) + code = "IJulia.Pkg.REPLMode.do_cmd(IJulia.minirepl[], \"" * + escape_string(code[2:end]) * "\"; do_rethrow=true)" + end + + # a cell beginning with "? ..." is interpreted as a help request + hcode = replace(code, r"^\s*\?" => "") + + try + for hook in preexecute_hooks + invokelatest(hook) + end + + + ans = result = if hcode != code # help request + Core.eval(Main, helpmode(hcode)) + else + #run the code! + occursin(magics_regex, code) && match(magics_regex, code).offset == 1 ? magics_help(code) : + SOFTSCOPE[] ? softscope_include_string(current_module[], code, "In[$n]") : + include_string(current_module[], code, "In[$n]") + end + + if silent + result = nothing + elseif result !== nothing + if store_history + Out[n] = result + end + end + + user_expressions = Dict() + for (v,ex) in msg.content["user_expressions"] + try + value = include_string(current_module[], ex) + # Like the IPython reference implementation, we return + # something that looks like a `display_data` but also has a + # `status` field: + # https://github.com/ipython/ipython/blob/master/IPython/core/interactiveshell.py#L2609-L2614 + user_expressions[v] = Dict("status" => "ok", + "data" => display_dict(value), + "metadata" => metadata(value)) + catch e + # The format of user_expressions[v] is like `error` except that + # it also has a `status` field: + # https://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-errors + user_expressions[v] = Dict("status" => "error", + error_content(e, catch_backtrace())...) + end + end + + for hook in postexecute_hooks + invokelatest(hook) + end + + # flush pending stdio + flush_all() + + undisplay(result) # dequeue if needed, since we display result in pyout + invokelatest(display) # flush pending display requests + + if result !== nothing + result_metadata = invokelatest(metadata, result) + result_data = invokelatest(display_dict, result) + send_ipython(publish[], + msg_pub(msg, "execute_result", + Dict("execution_count" => n, + "metadata" => result_metadata, + "data" => result_data))) + + end + send_ipython(requests[], + msg_reply(msg, "execute_reply", + Dict("status" => "ok", + "payload" => execute_payloads, + "execution_count" => n, + "user_expressions" => user_expressions))) + empty!(execute_payloads) + catch e + bt = catch_backtrace() + try + # flush pending stdio + flush_all() + for hook in posterror_hooks + invokelatest(hook) + end + catch + end + empty!(displayqueue) # discard pending display requests on an error + content = error_content(e,bt) + send_ipython(publish[], msg_pub(msg, "error", content)) + content["status"] = "error" + content["execution_count"] = n + send_ipython(requests[], msg_reply(msg, "execute_reply", content)) + end +end diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index 1ae541e..f9edebf 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -21,7 +21,7 @@ syntax.add { { pattern = "-?%.?%d+f?", type = "number" }, { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator"}, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = {"@"," "}, type = "operator" }, + { pattern = "@[%a_][%w_]", type = "function" }, { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, { pattern = { "{", "}"}, type = "string"}, { pattern = "[%a_][%w_]*", type = "symbol" }, -- cgit v1.2.3 From 6222c6a2d24bec13ff8f6414377c8649b452ae3e Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 09:37:32 +0900 Subject: Minor bug fix --- me.jl | 144 ------------------------------------------------------------------ 1 file changed, 144 deletions(-) delete mode 100644 me.jl diff --git a/me.jl b/me.jl deleted file mode 100644 index 20dc224..0000000 --- a/me.jl +++ /dev/null @@ -1,144 +0,0 @@ -# Handers for execute_request and related messages, which are -# the core of the Jupyter protocol: execution of Julia code and -# returning results. - -import Base.Libc: flush_cstdio -import Pkg - -# global variable so that display can be done in the correct Msg context -execute_msg = Msg(["julia"], Dict("username"=>"jlkernel", "session"=>uuid4()), Dict()) -# global variable tracking the number of bytes written in the current execution -# request -const stdio_bytes = Ref(0) - -import REPL: helpmode - -# use a global array to accumulate "payloads" for the execute_reply message -const execute_payloads = Dict[] - -function execute_request(socket, msg) - code = msg.content["code"] - @vprintln("EXECUTING", code) - global execute_msg = msg - global n, In, Out, ans - stdio_bytes[] = 0 - silent = msg.content["silent"] - store_history = get(msg.content, "store_history", !silent) - empty!(execute_payloads) - - if !silent - n += 1 - send_ipython(publish[], - msg_pub(msg, "execute_input", - Dict("execution_count" => n, - "code" => code))) - end - - silent = silent || REPL.ends_with_semicolon(code) - if store_history - In[n] = code - end - - # "; ..." cells are interpreted as shell commands for run - code = replace(code, r"^\s*;.*$" => - m -> string(replace(m, r"^\s*;" => "Base.repl_cmd(`"), - "`, stdout)")) - - - # "] ..." cells are interpreted as pkg shell commands - if occursin(r"^\].*$", code) - code = "IJulia.Pkg.REPLMode.do_cmd(IJulia.minirepl[], \"" * - escape_string(code[2:end]) * "\"; do_rethrow=true)" - end - - # a cell beginning with "? ..." is interpreted as a help request - hcode = replace(code, r"^\s*\?" => "") - - try - for hook in preexecute_hooks - invokelatest(hook) - end - - - ans = result = if hcode != code # help request - Core.eval(Main, helpmode(hcode)) - else - #run the code! - occursin(magics_regex, code) && match(magics_regex, code).offset == 1 ? magics_help(code) : - SOFTSCOPE[] ? softscope_include_string(current_module[], code, "In[$n]") : - include_string(current_module[], code, "In[$n]") - end - - if silent - result = nothing - elseif result !== nothing - if store_history - Out[n] = result - end - end - - user_expressions = Dict() - for (v,ex) in msg.content["user_expressions"] - try - value = include_string(current_module[], ex) - # Like the IPython reference implementation, we return - # something that looks like a `display_data` but also has a - # `status` field: - # https://github.com/ipython/ipython/blob/master/IPython/core/interactiveshell.py#L2609-L2614 - user_expressions[v] = Dict("status" => "ok", - "data" => display_dict(value), - "metadata" => metadata(value)) - catch e - # The format of user_expressions[v] is like `error` except that - # it also has a `status` field: - # https://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-errors - user_expressions[v] = Dict("status" => "error", - error_content(e, catch_backtrace())...) - end - end - - for hook in postexecute_hooks - invokelatest(hook) - end - - # flush pending stdio - flush_all() - - undisplay(result) # dequeue if needed, since we display result in pyout - invokelatest(display) # flush pending display requests - - if result !== nothing - result_metadata = invokelatest(metadata, result) - result_data = invokelatest(display_dict, result) - send_ipython(publish[], - msg_pub(msg, "execute_result", - Dict("execution_count" => n, - "metadata" => result_metadata, - "data" => result_data))) - - end - send_ipython(requests[], - msg_reply(msg, "execute_reply", - Dict("status" => "ok", - "payload" => execute_payloads, - "execution_count" => n, - "user_expressions" => user_expressions))) - empty!(execute_payloads) - catch e - bt = catch_backtrace() - try - # flush pending stdio - flush_all() - for hook in posterror_hooks - invokelatest(hook) - end - catch - end - empty!(displayqueue) # discard pending display requests on an error - content = error_content(e,bt) - send_ipython(publish[], msg_pub(msg, "error", content)) - content["status"] = "error" - content["execution_count"] = n - send_ipython(requests[], msg_reply(msg, "execute_reply", content)) - end -end -- cgit v1.2.3 From ee62ab2adb35aff979621fe144662a8583566b15 Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 10:22:10 +0900 Subject: Updates Julia Syntax --- plugins/language_julia.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index f9edebf..d47b87e 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -21,16 +21,16 @@ syntax.add { { pattern = "-?%.?%d+f?", type = "number" }, { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator"}, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "@[%a_][%w_]", type = "function" }, - { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, - { pattern = { "{", "}"}, type = "string"}, + { pattern = "@[%a_][%w_]*[%a_][%w_]", type = "function" }, + { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, + { pattern = "{[%a_][%w_]*}", type = "string"}, { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { -- keywords ["baremodule"] = "keyword", ["begin"] = "keyword", - ["break`"] = "keyword", + ["break"] = "keyword", ["catch"] = "keyword", ["const"] = "keyword", ["continue"] = "keyword", @@ -53,6 +53,7 @@ syntax.add { ["local"] = "keyword", ["macro"] = "keyword", ["module"] = "keyword", + ["mutable"] = "keyword", ["quote"] = "keyword", ["return"] = "keyword", ["try"] = "keyword", @@ -85,10 +86,11 @@ syntax.add { ["Matrix"] = "keyword2", ["Ref"] = "keyword2", ["String"] = "keyword2", + ["Function"] = "keyword2", -- literals ["missing"] = "literal", ["true"] = "literal", ["false"] = "literal", - }, + } } -- cgit v1.2.3 From dc518e4d03d39a789e65e46b1098b315eda1f8b3 Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 10:33:52 +0900 Subject: Added nothing literal --- plugins/language_julia.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index d47b87e..5ae8e9b 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -92,5 +92,6 @@ syntax.add { ["missing"] = "literal", ["true"] = "literal", ["false"] = "literal", + ["nothing"] = "literal", } } -- cgit v1.2.3 From 8d3c856a3feb647f87b4a098e27f383bbedcda1d Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Thu, 25 Nov 2021 10:42:36 +0900 Subject: Minor fix --- plugins/language_julia.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index 5ae8e9b..b0f953f 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -30,7 +30,7 @@ syntax.add { -- keywords ["baremodule"] = "keyword", ["begin"] = "keyword", - ["break"] = "keyword", + ["break"] = "keyword", ["catch"] = "keyword", ["const"] = "keyword", ["continue"] = "keyword", @@ -60,6 +60,7 @@ syntax.add { ["typeof"] = "keyword", ["using"] = "keyword", ["while"] = "keyword", + ["where"] = "keyword", -- types ["struct"] = "keyword2", @@ -92,6 +93,6 @@ syntax.add { ["missing"] = "literal", ["true"] = "literal", ["false"] = "literal", - ["nothing"] = "literal", + ["nothing"] = "literal", } } -- cgit v1.2.3 From 4f5d7e9ddfde8feb0d8d9efb91f6cbb47e99137b Mon Sep 17 00:00:00 2001 From: JobinsJC Date: Sun, 28 Nov 2021 10:41:42 +0900 Subject: More improvements --- plugins/language_julia.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index b0f953f..6dea1a8 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -11,20 +11,21 @@ syntax.add { patterns = { { pattern = { "#=", "=#" }, type = "comment" }, { pattern = "#.-\n", type = "comment" }, - { pattern = { '[ruU]?"""', '"""'; '\\' }, type = "string" }, - { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = { "`", "`", '\\' }, type = "string" }, + { pattern = '[%a_][%w_]*"""*[%a_][%w_]*"""', type = "function" }, + { pattern = { '[ruU]?"', '"', '\\' }, type = "string" }, + { pattern = { "[ruU]?'", "'", '\\' }, type = "string" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, + { pattern = "-?0b[%x_]+", type = "number" }, { pattern = "-?%d+_%d", type = "number" }, { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, { pattern = "-?%.?%d+f?", type = "number" }, - { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator"}, - { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "@[%a_][%w_]*[%a_][%w_]", type = "function" }, - { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, - { pattern = "{[%a_][%w_]*}", type = "string"}, - { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "@[%a_][%w_]*[%a_][%w_]", type = "function" }, + { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, + { pattern = "{[%a_][%w_]*}", type = "string" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { -- keywords @@ -88,11 +89,14 @@ syntax.add { ["Ref"] = "keyword2", ["String"] = "keyword2", ["Function"] = "keyword2", + ["Number"] = "keyword2", -- literals ["missing"] = "literal", ["true"] = "literal", ["false"] = "literal", ["nothing"] = "literal", + ["Inf"] = "literal", + ["NaN"] = "literal", } } -- cgit v1.2.3 From 6bdc51987ec0d08bb7664a00089dc165ea742e5d Mon Sep 17 00:00:00 2001 From: Nightwing Date: Fri, 3 Dec 2021 22:42:12 +0900 Subject: Improved Julia syntax --- plugins/language_julia.lua | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index 6dea1a8..ecdbdc0 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -9,22 +9,25 @@ syntax.add { files = { "%.jl$" }, comment = "#", patterns = { - { pattern = { "#=", "=#" }, type = "comment" }, - { pattern = "#.-\n", type = "comment" }, - { pattern = '[%a_][%w_]*"""*[%a_][%w_]*"""', type = "function" }, - { pattern = { '[ruU]?"', '"', '\\' }, type = "string" }, - { pattern = { "[ruU]?'", "'", '\\' }, type = "string" }, + {pattern = {"#=", "=#"}, type="comment" }, + {pattern = "#.*$", type="comment" }, + { pattern = "%d%w*[%.-+*//]", type = "number" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, { pattern = "-?0b[%x_]+", type = "number" }, { pattern = "-?%d+_%d", type = "number" }, { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, { pattern = "-?%.?%d+f?", type = "number" }, - { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator" }, + { pattern = "[^%d%g]%:%a*", type = "function" }, + { pattern = "[%+%-=/%*%^%%<>!~|&%:]",type = "operator"}, + { pattern = '""".*"""', type = "string" }, + { pattern = '".*"', type = "string" }, + { pattern = '[bv]".*"', type = "string" }, + { pattern = 'r".*$', type = "string" }, + { pattern = "'\\.*'", type = "string" }, + { pattern = "'.'", type = "string" }, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "@[%a_][%w_]*[%a_][%w_]", type = "function" }, - { pattern = "[%a_][%w_]*%.*!", type = "keyword2" }, - { pattern = "{[%a_][%w_]*}", type = "string" }, + { pattern = ".*!", type="function"}, { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { @@ -53,6 +56,7 @@ syntax.add { ["let"] = "keyword", ["local"] = "keyword", ["macro"] = "keyword", + ["type"] = "keyword", ["module"] = "keyword", ["mutable"] = "keyword", ["quote"] = "keyword", @@ -65,12 +69,13 @@ syntax.add { -- types ["struct"] = "keyword2", - ["abstract type"] = "keyword2", - ["primitive type"] = "keyword2", - ["mutable struct"] = "keyword2", + ["abstract"] = "keyword2", + ["primitive"] = "keyword2", + ["mutable"] = "keyword2", ["Char"] = "keyword2", ["Bool"] = "keyword2", ["Int"] = "keyword2", + ["Integer"] = "keyword2", ["Int8"] = "keyword2", ["UInt8"] = "keyword2", ["Int16"] = "keyword2", -- cgit v1.2.3 From 9d91e39bf3711f14c5badb300d4ba8a4c24117c0 Mon Sep 17 00:00:00 2001 From: Nightwing Date: Fri, 3 Dec 2021 23:07:28 +0900 Subject: Finally --- plugins/language_julia.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index ecdbdc0..e62a9b2 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -11,6 +11,11 @@ syntax.add { patterns = { {pattern = {"#=", "=#"}, type="comment" }, {pattern = "#.*$", type="comment" }, + { pattern = { 'icxx"""', '"""' }, type = "string", syntax = ".cpp" }, + { pattern = { 'cxx"""', '"""' }, type = "string", syntax = ".cpp" }, + { pattern = { 'py"""', '"""' }, type = "string", syntax = ".py" }, + { pattern = { 'js"""', '"""' }, type = "string", syntax = ".js" }, + { pattern = { 'md"""', '"""' }, type = "string", syntax = ".md" }, { pattern = "%d%w*[%.-+*//]", type = "number" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, @@ -27,7 +32,7 @@ syntax.add { { pattern = "'\\.*'", type = "string" }, { pattern = "'.'", type = "string" }, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = ".*!", type="function"}, + { pattern = "%g*!", type="function"}, { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { -- cgit v1.2.3