Skip to content
Closed
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
12 changes: 10 additions & 2 deletions coq/coq-system.el
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,19 @@ If ARITY is nil, return SWITCH."
(let ((arguments (cl-subseq raw-args 0 arity)))
(cons switch arguments)))))

(defun coq--filter-project-file-commented-lines (contents)
"Filter out the lines starting with '#' of string CONTENTS."
(let* ((l (split-string contents "^"))
(lrem (cl-remove-if (lambda (s) (string-match "^[[:blank:]]*#" s)) l)))
(cl-reduce (lambda (a b) (cl-concatenate 'string a b))
lrem)))

(defun coq--read-options-from-project-file (contents)
"Read options from CONTENTS of _CoqProject.
Returns a mixed list of option-value pairs and strings."
(let ((raw-args (split-string-and-unquote contents coq--project-file-separator))
(options nil))
(let* ((contents (coq--filter-project-file-commented-lines contents))
(raw-args (split-string-and-unquote contents coq--project-file-separator))
(options nil))
(while raw-args
(let* ((switch (pop raw-args))
(arity (cdr (assoc switch coq--makefile-switch-arities))))
Expand Down
Loading