소스 검색

Improved format of stack-effect strings.

Paul Onions 10 년 전
부모
커밋
5a1eaf2c25
5개의 변경된 파일18개의 추가작업 그리고 5개의 파일을 삭제
  1. 0 0
      data/sysrpl-data.38G.el
  2. 0 0
      data/sysrpl-data.39G.el
  3. 0 0
      data/sysrpl-data.48G.el
  4. 0 0
      data/sysrpl-data.49G.el
  5. 18 5
      rpl-edb.el

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
data/sysrpl-data.38G.el


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
data/sysrpl-data.39G.el


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
data/sysrpl-data.48G.el


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
data/sysrpl-data.49G.el


+ 18 - 5
rpl-edb.el

@@ -38,7 +38,7 @@ As a side-effect set point to the start of the next line."
 
 ;;; Parsing identifier lines
 ;;;
-(defun rpl-trim-stack-effect-description (lines)
+(defun rpl-trim-stack-effect-lines (lines)
   "Trim leading and trailing fluff from strings in LINES list."
   (let ((left-edge 1000))
     (dolist (s lines)
@@ -51,6 +51,13 @@ As a side-effect set point to the start of the next line."
                 (substring s left-edge)))
             lines)))
 
+(defun rpl-tidy-stack-effect-lines (lines)
+  "Tidy-up stack-effect lines."
+  (rpl-trim-stack-effect-lines
+   (mapcar (lambda (ln)
+             (replace-regexp-in-string "\\\\->" "-->" ln))
+           lines)))
+
 (defun rpl-edb-consume-ident-line ()
   "Consume an EDB identifier line.
 Return a list of two strings: the identifier and its stack effect
@@ -65,7 +72,7 @@ description.  Move point to the start of the next line."
              (while (and (> (length (car desc)) 0)
                          (string-match ".*\\\\[[:blank:]]*$" (car desc)))
                (setq desc (cons (rpl-edb-get-line) desc)))
-             (list name (rpl-trim-stack-effect-description (reverse desc)))))
+             (list name (rpl-tidy-stack-effect-lines (reverse desc)))))
           (t
            (list nil nil)))))
 
@@ -140,7 +147,7 @@ Return a string.  Move point to the start of the next line."
   "A place on which to push the entries parsed from the EDB file.")
 
 (defun rpl-edb-parse-buffer ()
-  "Parse the current buffer, assumed to be the entries.db file.
+  "Parse the current buffer, assumed to be the ``entries.db'' file.
 Set `rpl-edb-entries' to the parsed results, a list of EDB
 entries, where each entry has the format:
   (NAMES STACK-EFFECT DESCRIPTION CALC-INFOS)
@@ -240,13 +247,19 @@ calculator model, e.g. :48G, :49G etc."
   (concat "sysrpl-data." (substring (symbol-name calculator) 1) ".el"))
 
 (defun rpl-edb-make-calculator-data-file (calculator)
-  ""
+  "Make the appropriate SysRPL data file for CALCULATOR.
+The CALCULATOR is identified by keyword: :38G, :39G, :48G
+or :49G."
   (cl-assert (keywordp calculator))
   (rpl-write-data-file (rpl-edb-generate-calculator-data calculator)
                        (rpl-edb-make-data-filename calculator)))
 
 (defun rpl-edb-make-all-data-files ()
-  ""
+  "Create all SysRPL data files.
+Assumes the current buffer contains the ``entries.db'' file
+created by Carsten Dominik, parsing it if necessary to set the
+`rpl-edb-entries' variable, then writing captured data to the
+SysRPL data files, one for each calculator type."
   (interactive)
   (unless rpl-edb-entries
     (rpl-edb-parse-buffer))

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.