emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 0dc788aa01 1/3: ; Remove GRAMMAR-DIR from treesit-language-sour


From: Yuan Fu
Subject: emacs-29 0dc788aa01 1/3: ; Remove GRAMMAR-DIR from treesit-language-source-alist
Date: Sat, 31 Dec 2022 20:10:15 -0500 (EST)

branch: emacs-29
commit 0dc788aa013db1222918c2dfe2ffad3d17b4b9f6
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; Remove GRAMMAR-DIR from treesit-language-source-alist
    
    Removing it doesn't affect building all the language grammars in
    batch.sh, so it must be an artifact I added for something else and
    later forgot to remove.
    
    * lisp/treesit.el (treesit-language-source-alist)
    (treesit--install-language-grammar-1): Remove GRAMMAR-DIR.
---
 lisp/treesit.el | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index e3edaabe99..477abf65fb 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2619,7 +2619,7 @@ window."
 
 The value should be an alist where each element has the form
 
-    (LANG . (URL SOURCE-DIR GRAMMAR-DIR CC C++))
+    (LANG . (URL SOURCE-DIR CC C++))
 
 Only LANG and URL are mandatory.  LANG is the language symbol.
 URL is the Git repository URL for the grammar.
@@ -2627,9 +2627,6 @@ URL is the Git repository URL for the grammar.
 SOURCE-DIR is the relative subdirectory in the repository in which
 the grammar's parser.c file resides, defaulting to \"src\".
 
-GRAMMAR-DIR is the relative subdirectory in the repository
-in which the grammar.js file resides, defaulting to \".\".
-
 CC and C++ are C and C++ compilers, defaulting to \"cc\" and
 \"c++\", respectively.")
 
@@ -2683,7 +2680,7 @@ content as signal data, and erase buffer afterwards."
     (erase-buffer)))
 
 (defun treesit--install-language-grammar-1
-    (out-dir lang url &optional source-dir grammar-dir cc c++)
+    (out-dir lang url &optional source-dir cc c++)
   "Install and compile a tree-sitter language grammar library.
 
 OUT-DIR is the directory to put the compiled library file.  If it
@@ -2698,7 +2695,6 @@ function signals an error."
          (default-directory (make-temp-file "treesit-workdir" t))
          (workdir (expand-file-name "repo"))
          (source-dir (expand-file-name (or source-dir "src") workdir))
-         (grammar-dir (expand-file-name (or grammar-dir "") workdir))
          (cc (or cc (seq-find #'executable-find '("cc" "gcc" "c99"))
                  ;; If no C compiler found, just use cc and let
                  ;; `call-process' signal the error.
@@ -2717,10 +2713,8 @@ function signals an error."
           (treesit--call-process-signal
            "git" nil t nil "clone" url "--depth" "1" "--quiet"
            workdir)
-          ;; cp "${grammardir}"/grammar.js "${sourcedir}"
-          (copy-file (expand-file-name "grammar.js" grammar-dir)
-                     (expand-file-name "grammar.js" source-dir)
-                     t t)
+          ;; We need to go into the source directory because some
+          ;; header files use relative path (#include "../xxx").
           ;; cd "${sourcedir}"
           (setq default-directory source-dir)
           (message "Compiling library")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]