Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lua support #303

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/kernel/comby_kernel.mli
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ module Matchers : sig
module Fsharp : Language.S
module Pascal : Language.S
module Julia : Language.S
module Lua : Language.S
module Fortran : Language.S
module Haskell : Language.S
module HCL : Language.S
Expand Down Expand Up @@ -716,6 +717,7 @@ module Matchers : sig
module Fsharp : Matcher.S
module Pascal : Matcher.S
module Julia : Matcher.S
module Lua : Matcher.S
module Fortran : Matcher.S
module Haskell : Matcher.S
module HCL : Matcher.S
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/matchers/engine.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module Make (Make : Types.Language.S -> Types.Metasyntax.S -> Types.External.S -
module Fsharp = Make (Fsharp) (Metasyntax.Default) (External.Default)
module Pascal = Make (Pascal) (Metasyntax.Default) (External.Default)
module Julia = Make (Julia) (Metasyntax.Default) (External.Default)
module Lua = Make (Lua) (Metasyntax.Default) (External.Default)
module Fortran = Make (Fortran) (Metasyntax.Default) (External.Default)
module Haskell = Make (Haskell) (Metasyntax.Default) (External.Default)
module HCL = Make (HCL) (Metasyntax.Default) (External.Default)
Expand Down Expand Up @@ -115,6 +116,7 @@ module Make (Make : Types.Language.S -> Types.Metasyntax.S -> Types.External.S -
; (module GraphQL)
; (module Dhall)
; (module Julia)
; (module Lua)
; (module Kotlin)
; (module Latex)
; (module Lisp)
Expand Down
25 changes: 25 additions & 0 deletions lib/kernel/matchers/languages.ml
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,31 @@ module Julia = struct
end
end

module Lua = struct
module Info = struct
let name = "Lua"
let extensions = [".lua"]
end

module Syntax = struct
include Generic.Syntax

let user_defined_delimiters =
Generic.Syntax.user_defined_delimiters
@
[ "if", "end"
; "for", "end"
; "function", "end"
; "do", "end"
; "while", "end"
; "until", "end"
]
let comments =
[ Until_newline "--"
]
end
end

module Matlab = struct
module Info = struct
let name = "MATLAB"
Expand Down
1 change: 1 addition & 0 deletions lib/kernel/matchers/languages.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module Reason : Language.S
module Fsharp : Language.S
module Pascal : Language.S
module Julia : Language.S
module Lua : Language.S
module Fortran : Language.S
module HCL : Language.S
module Haskell : Language.S
Expand Down
1 change: 1 addition & 0 deletions lib/kernel/matchers/types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ module Engine = struct
module Fsharp : Matcher.S
module Pascal : Matcher.S
module Julia : Matcher.S
module Lua : Matcher.S
module Fortran : Matcher.S
module Haskell : Matcher.S
module HCL : Matcher.S
Expand Down
1 change: 1 addition & 0 deletions test/common/test_cli_list.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ let%expect_test "list_languages" =
-matcher .gql GraphQL
-matcher .dhall Dhall
-matcher .jl Julia
-matcher .lua Lua
-matcher .kt Kotlin
-matcher .tex LaTeX
-matcher .lisp Lisp
Expand Down