Skip to content

Commit

Permalink
Merge pull request #25 from WHForks/add-runnables
Browse files Browse the repository at this point in the history
Add entry point detection
  • Loading branch information
tgodzik authored Oct 10, 2024
2 parents 1e33d7e + 19ec9c7 commit e3cc843
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions languages/scala/runnables.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(
(
(function_definition
(annotation
name: (type_identifier) @run
)
name: _
parameters: _
body: _
) @_scala_main_function_end
(#eq? @run "main")
)
(#set! tag scala-main)
)

(
(
(object_definition
extend: (extends_clause
type: (type_identifier) @run
)
) @_scala_app_object_end
(#eq? @run "App")
)
(#set! tag scala-main)
)

(
(
(object_definition
name: _
body: (template_body
(function_definition
name: (identifier) @run
) @_jvm_main_function_end
)
)
(#eq? @run "main")
)
(#set! tag scala-main)
)

0 comments on commit e3cc843

Please sign in to comment.