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

Clojure improvements #4123

Open
aartaka opened this issue Nov 20, 2024 · 3 comments
Open

Clojure improvements #4123

aartaka opened this issue Nov 20, 2024 · 3 comments

Comments

@aartaka
Copy link

aartaka commented Nov 20, 2024

The name of the parser: clojure

Ctags only supports functions and namespaces in Clojure, lacking e.g. types and variables.

Find the examples of def and defonce for variables; defmacro for macros; defmulti for multimethods and defmethod for methods; deftype and defrecord for types; defprotocol and definterface for Clojure and Java interfaces respectively.

I cannot provide examples beyond these posts because most of the Clojure I do it private/proprietary 🙈

The version of ctags:

$ ctags --version
Universal Ctags 6.1.0(p6.1.20241117.0), Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Nov 18 2024, 17:31:59
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc, +optscript, +pcre2

How do you get ctags binary: pacman on Arch Linux

@masatake
Copy link
Member

I will accept pull requests to solve this issue.
However, I will not work on this issue directly; I would like to solve it using a Sexp-based meta parser.

HOWEVER, '.b' test cases are welcome.
People requesting to add parsers supporting new languages and/or to enhance parsers expect ctags developers to know the target languages. The expectation is wrong. The developers know only a tiny subset of the languages that ctags supports. Generally, the developers postpone the tasks related to unknown languages.

Preparing test cases is one of the ways to drive the developers. The test cases help the developers by reducing the time to learn the target language. See #4065.

The value of test cases is immeasurable. We can add code to extract def* from the current implementation. I will call the code a direct solution. I want to avoid the direct solution.
I want to implement a Sexp-based meta-parser that can be used as reusable routines to reimplement Lisp, EmacsLisp, Scheme, and Clojure parsers. I will call supporting def* in a new Close parser based on the meta parser an indirect solution. The test cases can be used in both solutions. A test case is an implementation neutral.

@aartaka
Copy link
Author

aartaka commented Nov 20, 2024

Fair, I'll come up with test cases 👍

@masatake
Copy link
Member

Thank you. I would like you to read https://docs.ctags.io/en/latest/testing-parser.html#units-test-facility .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants