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

Lisp: introduce new kinds: variable, macro, and consant #2425

Merged
merged 6 commits into from
Feb 19, 2020
Merged
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
4 changes: 4 additions & 0 deletions Tmain/pretend-option.d/stdout-expected.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
u unknown type of definitions
f functions
v variables
m macros
c constants
1 change: 1 addition & 0 deletions Units/parser-emacsLisp.r/definitions.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--fields=+K
23 changes: 23 additions & 0 deletions Units/parser-emacsLisp.r/definitions.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
a0 input.el /^(defun a0 (n) (+ 1 n))$/;" function
b0 input.el /^(defvar b0 3)$/;" variable
c0 input.el /^(defconstant c0 5)$/;" unknown
defunknown0 input.el /^(defmacro defunknown0 (s)$/;" macro
defunknown1 input.el /^(defmacro* defunknown1 (s)$/;" macro
e0 input.el /^(defalias 'e0 'a0)$/;" alias
f0 input.el /^(defvaralias 'f0 'b0)$/;" varalias
g0 input.el /^(defsubst g0 () nil)$/;" subst
h0 input.el /^(define-error 'h0 (purecopy "TEST"))$/;" error
h1 input.el /^(define-error (quote h1) (purecopy "TEST"))$/;" error
i0 input.el /^(define-minor-mode i0 "DOC")$/;" minorMode
j0 input.el /^(define-derived-mode j0 nil "TEST")$/;" derivedMode
k0 input.el /^(defcustom k0 t$/;" custom
l0 input.el /^(defgroup l0 nil "DOC" :group 'editing)$/;" group
m0 input.el /^(defface m0$/;" face
n0 input.el /^(deftheme n0 "DOC")$/;" theme
o0 input.el /^(defvar-local o0 1)$/;" variable
p0 input.el /^(define-globalized-minor-mode p0$/;" minorMode
q0 input.el /^(define-obsolete-function-alias 'q0 'f0)$/;" alias
r0 input.el /^(define-global-minor-mode r0$/;" minorMode
s0 input.el /^(define-inline s0 (n)$/;" inline
t0 input.el /^(defun* t0 (n)$/;" function
u0 input.el /^(defsubst* u0 () nil)$/;" subst
64 changes: 64 additions & 0 deletions Units/parser-emacsLisp.r/definitions.d/input.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
(defun a0 (n) (+ 1 n))

(defvar b0 3)

(defconstant c0 5)

(defmacro defunknown0 (s)
`(defconstant ,s 'unknown))

(defalias 'e0 'a0)

(defvaralias 'f0 'b0)

(defsubst g0 () nil)

(define-error 'h0 (purecopy "TEST"))
(define-error (quote h1) (purecopy "TEST"))

(define-minor-mode i0 "DOC")

(define-derived-mode j0 nil "TEST")

(defcustom k0 t
"doc"
:type 'number
:group 'l0
:version "22.1")

(defgroup l0 nil "DOC" :group 'editing)

(defface m0
'((t (:inherit region)))
"DOC"
:group 'l0
:version "22.1")

(deftheme n0 "DOC")

(condition-case nil
(define-key dont-capture-me-map "m" 'ctags)
(error nil))

(defvar-local o0 1)


(define-globalized-minor-mode p0
visual-line-mode turn-on-visual-line-mode)

(define-obsolete-function-alias 'q0 'f0)

(define-global-minor-mode r0
subword-mode turn-on-subword-mode)

(define-inline s0 (n)
(+ n 1))

(defun* t0 (n)
(+ n 1))

(defmacro* defunknown1 (s)
`(defconstant ,s 'unknown))

(defsubst* u0 () nil)

1 change: 1 addition & 0 deletions Units/parser-emacsLisp.r/newline.b/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f input.el /^ f () 1)$/;" f
2 changes: 2 additions & 0 deletions Units/parser-emacsLisp.r/newline.b/input.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(defun
f () 1)
5 changes: 5 additions & 0 deletions Units/parser-emacsLisp.r/simple-emacsLisp.d/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The input is taken from simple.el of GNU Emacs. I didn't check all
the entries of expected.tags because it has so many entires. However,
I put this to our git repository because there are so various def* in
simple.el. So when we change the code of EmacsLisp parser, this test
case may notify something useful.
2 changes: 2 additions & 0 deletions Units/parser-emacsLisp.r/simple-emacsLisp.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+K
444 changes: 444 additions & 0 deletions Units/parser-emacsLisp.r/simple-emacsLisp.d/expected.tags

Large diffs are not rendered by default.

Loading