Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

159 lines (148 sloc) 18.73 kB
;ELC
;;; Compiled by rscholz@mde1.home on Tue Jan 1 21:47:07 2002
;;; from file /home/rscholz/el/csp-mode/csp-mode.el
;;; in Emacs version 21.1.50.2
;;; with bytecomp version 2.93
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(or (and (boundp 'epoch::version) epoch::version)
(string-lessp emacs-version "19.29")))
(error "`csp-mode.el' was compiled for Emacs 19.29 or later"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#@42 Abbrev table in use in csp-mode buffers.
(defvar csp-mode-abbrev-table nil (#$ . 605))
(define-abbrev-table 'csp-mode-abbrev-table nil)
#@26 Keymap used in csp mode.
(defvar csp-mode-map nil (#$ . 747))
(byte-code "\204a\306 \307\310\311#\210\307\312\313#\210\307\314\315#\210\307\316\317#\210\307\320\321#\210\307\322\323#\210\307\324\325#\210\307\326\325#\210\307\327\330#\210\307\331\330#\210\307\332\333#\210\307\334\333#\210\307\335\336#\210\307\337\340#\210\307\341\342#\210\302 B\343\302!\204m\344\345 B\346\347\350!\210)\305 B\351\347\352!\210)\353 B\354 \355Q@\347\356!\210)\357 B\360 \361QA\347\362!\210)\363 B\364B\347\365!\210)\366 B\367C\347\370!\210)\371 B\372D\347\373!\210)\374 B\372E\347\375!\210)\376 B\377F\347\201K!\210)\201L B\201MG\347\201N!\210)\201O B\201PH\347\201Q!\210)\201L B\201MI\347\201R!\210)\201S B\201TJ\347\201U!\210)\306\207" [csp-mode-map current-load-list csp-keywords #1=#:defconst-tmp-var #2=#:defconst-tmp-var csp-name-re make-sparse-keymap define-key ";" electric-csp-semi [67108926] electric-csp-arrow "\n" electric-csp-terminate-line " " electric-csp-tab "e" electric-csp-external-choice "l" electric-csp-interleave "~" electric-csp-internal-choice "i" "|" electric-csp-sync "p" "{" electric-csp-channel-set "s" "" csp-comment-area "" csp-uncomment-area "" csp-validate boundp ("STOP" "SKIP" "CHAOS" "if" "then" "else" "channel" "datatype" "nametype" "let" "ldot" "lambda" "within" "and" "or" "not" "transparent" "true" "false") csp-symbol-re "\\<[a-zA-Z_][a-zA-Z_0-9.!?,_]*'*\\>" eval (defconst csp-symbol-re #1#) "\\<\\([a-zA-Z][a-zA-Z_0-9_]*'*\\([ ]*([ a-zA-Z0-9_\\+\\-\\*/%&|'().]+\\(,[ a-zA-Z0-9_\\+\\-\\*/%&|'().]+\\)*)\\)?\\)" (defconst csp-name-re #2#) csp-declaration-re "^[ ]*\\(\\<\\(channel\\|datatype\\|nametype\\|transparent\\)\\>\\|" "[ ]*\\(\\(=[^=]\\)\\|:\\)\\)" (defconst csp-declaration-re #3=#:defconst-tmp-var) csp-defun-re "^[ ]*" "[ ]*=[^=]" (defconst csp-defun-re #4=#:defconst-tmp-var) csp-assert-re "[ ]*\\<\\(assert\\)\\>" (defconst csp-assert-re #5=#:defconst-tmp-var) csp-sub-block-re "(*\\<\\(then\\|else\\)\\>" (defconst csp-sub-block-re #6=#:defconst-tmp-var) csp-noindent-re "\\<\\(then\\|else\\)\\>" (defconst csp-noindent-re #7=#:defconst-tmp-var) csp-nosemi-re (defconst csp-nosemi-re #8=#:defconst-tmp-var) csp-autoindent-lines-re "\\<\\(else\\)\\>" #3# #4# #5# #6# #7# #8# #9=#:defconst-tmp-var #10=#:defconst-tmp-var #11=#:defconst-tmp-var #12=#:defconst-tmp-var #13=#:defconst-tmp-var (defconst csp-autoindent-lines-re #9#) csp-logical-op-re "\\<\\(and\\|or\\|not\\)\\>" (defconst csp-logical-op-re #10#) csp-boolean-re "\\<\\(true\\|false\\)\\>" (defconst csp-boolean-re #11#) (defconst csp-logical-op-re #12#) csp-op-re "\\<\\(and\\|or\\|not\\)\\>\\|<=\\|>=\\|@\\|-?>\\|<-?\\|*\\|==\\|!=\\|!\\|\\\\\\|/\\|:\\|;\\|?\\|#\\|&\\||~|\\|\\[\\]\\|\\[\\[\\|\\]\\]\\|\\[|?\\||?\\]\\|{|?\\||?}\\|||?|?\\|\\^\\|\\+\\|\\%\\|\\[\\([TF]\\|FD\\)=" (defconst csp-op-re #13#)] 4)
#@42 Syntax table in use in csp-mode buffers.
(defvar csp-mode-syntax-table nil (#$ . 3643))
(byte-code "\204\213\306 \307\310\311#\210\307\312\311#\210\307\313\314#\210\307\315\316#\210\307\317\311#\210\307\320\321#\210\307\322\323#\210\307\324\311#\210\307\325\326#\210\307\327\311#\210\307\330\311#\210\307\331\311#\210\307\332\311#\210\307\333\311#\210\307\334\311#\210\307\335\311#\210\307\336\311#\210\307\337\340#\210\307\341\340#\210\307\342\311#\210\307\343\311#\210\307\344\345#\210\346\347B\350\351BD\352 \n\353 \354\355\260\356B\357\360B\f\361BE\"\352 \362\363B6\363B\364\365BE\"7 8\306\207" [csp-mode-syntax-table csp-font-lock-keywords-1 csp-sub-block-re csp-boolean-re csp-defun-re csp-font-lock-keywords-2 make-syntax-table modify-syntax-entry 92 "." 47 40 "()" 41 ")(" 42 123 "(} 1" 125 "){ 4" 43 45 ". 123b" 61 37 60 62 38 124 91 93 95 "w" 39 63 33 10 "> b" "\\<\\(assert\\|channel\\|datatype\\|nametype\\|transparent\\|[Ii]nter\\|[Uu]nion\\|diff\\|card\\)\\>" font-lock-type-face "{-\\(\\([^-]*\\)\\|\\(-+[^-}]+\\)\\)*-}" font-lock-comment-face append "\\|\\<if\\>\\|" "\\|" "\\<\\(let\\|within\\|lambda\\|ldot\\)\\>" font-lock-keyword-face "\\<\\(SKIP\\|STOP\\|CHAOS\\)\\>" font-lock-function-name-face (1 'font-lock-function-name-face) "\\[\\([TF]\\|FD\\)=" font-lock-reference-face "\\<[a-zA-Z0-9_]\\(\\([a-zA-Z0-9.!?,_]*'+\\)\\|\\([a-zA-Z0-9.!?,_]*[a-zA-Z0-9!?,_]\\)\\)?\\>\\(\\.\\.?\\)\\<[a-zA-Z0-9_][a-zA-Z_0-9.!?,_]*'*\\>" (4 'font-lock-reference-face) csp-op-re csp-font-lock-keywords-3 csp-font-lock-keywords] 7)
#@66 *Indentation of csp statements with respect to containing block.
(defvar csp-indent-level 4 (#$ . -5216))
#@68 *Non-nil means each TAB in csp mode will be converted into spaces.
(defvar csp-untabify t (#$ . -5328))
#@94 *Non-nil means automatically newline after semicolons and the punctuation
mark after an end.
(defvar csp-auto-newline nil (#$ . -5438))
#@144 *Non-nil means TAB in csp mode should always reindent the current line,
regardless of where in the line point is when the TAB command is used.
(defvar csp-tab-always-indent t (#$ . -5581))
#@65 Alist of regexps to recognize error messages from csp-validate.
(defvar csp-validate-error-regexps '(("\\(error\\|warning\\) at \\([^,]+\\), line \\([0-9]+\\)" 2 3)) (#$ . 5776))
#@79 *If non-nil, ask about saving modified buffers before \[csp-validate] is run.
(defvar csp-offer-save t (#$ . -5961))
#@121 *The command to validate buffer.
The file name of current buffer's file will be appended to this,
separated by a space.
(defvar csp-validate-command "csp_parser" (#$ . -6085))
#@51 The command last used to validate in this buffer.
(defvar csp-saved-validate-command nil (#$ . 6267))
(defalias 'csp-get-beg-of-line #[(&optional arg) "\212\301!\210`)\207" [arg beginning-of-line] 2])
(put 'csp-get-beg-of-line 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'csp-get-end-of-line #[(&optional arg) "\212\210`)\207" [arg] 1])
(put 'csp-get-end-of-line 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'csp-within-string #[nil "\212\301\302\303\212\304!\210`*`\"8)\207" [arg 3 parse-partial-sexp nil beginning-of-line] 4])
(put 'csp-within-string 'byte-optimizer 'byte-compile-inline-expand)
#@1403 Major mode for editing CSP code written for fdr. \<csp-mode-map>
TAB indents for csp code. Delete converts tabs to spaces as it moves back.
LFD terminates current line after indenting it correctly. The next line is indented as well.
Other useful functions are:
\[csp-comment-area] - Put marked area in a comment.
\[csp-uncomment-area] - Uncomment an area commented with \[csp-comment-area] or "--".
\[electric-csp-semi] - If csp-auto-newline is set, will insert a semicolon at current position and terminate current line indenting the next.
\[electric-csp-arrow] - Same as before, but inserts an arrow at current position.
Variables controlling indentation/edit style:
csp-indent-level (default 4)
Indentation of csp statements with respect to containing block.
csp-auto-newline (default nil)
Non-nil means automatically newline after semicolons and the arrow
mark after an end.
csp-tab-always-indent (default t)
Non-nil means TAB in csp mode should always reindent the current line,
regardless of where in the line point is when the TAB command is used.
csp-untabify (default t)
Non-nil means TAB in csp mode will always be converted into spaces.
See also the user variables csp-type-keywords, csp-start-keywords and
csp-separator-keywords.
Turning on csp mode calls the value of the variable csp-mode-hook with
no args, if that value is non-nil.
(defalias 'csp-mode #[nil "\306 \210\307!\210\310\311 \312 !\210\313\314!\210\315\f\313\316!\210\317\313\320!\210\321\313\322!\210\323\313\324!\210\325\313\326!\210\327\313\330!\210\331\332\333!\207" [csp-mode-map major-mode mode-name csp-mode-abbrev-table local-abbrev-table csp-mode-syntax-table kill-all-local-variables use-local-map csp-mode "csp-mode" set-syntax-table make-local-variable indent-line-function csp-indent-line parse-sexp-ignore-comments nil case-fold-search t comment-start " --" comment-start-skip "--+ *" comment-end "" font-lock-defaults (csp-font-lock-keywords nil t) run-hooks csp-mode-hook] 2 (#$ . 6899) nil])
#@38 Terminate line and indent next line.
(defalias 'electric-csp-terminate-line #[nil "\212\300 \210\301\302w\210\303 \210)\304 \210\305 \210\303 \207" [beginning-of-line " " nil csp-indent-line delete-horizontal-space newline] 2 (#$ . 8962) nil])
#@36 Put the region into a csp comment.
(defalias 'csp-comment-area #[(start end) "\212b\210\302 \210` W\205\303\304!\204\305c\210\306y\210\202)\207" [start end beginning-of-line looking-at "^[ ]*--" "--" 1] 2 (#$ . 9213) "r"])
#@29 Uncomment a commented area.
(defalias 'csp-uncomment-area #[nil "\212\300 \210\301\302!\2056\303\304e\305#\204eb\210\301\302!\204\306y\210\307\310w\210\301\311!\2056\312\313!\210\306y\210\307\310w\210\202\")\207" [beginning-of-line looking-at "^[ ]*--" re-search-backward "^[ ]*\\([^- ]+\\|\\(-\\([^-]\\|$\\)\\)\\)" t 1 " " nil "--" delete-backward-char -2] 4 (#$ . 9450) nil])
(byte-code "\302B\303\304\305!\210)\302\207" [current-load-list #1=#:defconst-tmp-var csp-indent-alist ((block + ind csp-indent-level) (declaration . ind) (paramlist csp-indent-paramlist t) (comment csp-indent-comment t) (defun . ind) (contexp . ind) (unknown . 0) (string . 0) (assertion . 0)) eval (defconst csp-indent-alist #1#)] 2)
#@110 Indent from current point to column col. Tabs will be converted to sapces unless csp-untabify is set to nil.
(defalias 'csp-indent-to #[(col) "` j\210\n\205 \303`\")\207" [oldpos col csp-untabify untabify] 3 (#$ . 10185)])
#@109 Inserts as many spaces as a TAB-character represents at current position unless csp-untabify is set to nil.
(defalias 'csp-insert-tab #[nil "`\302c\210 \205 \303`\")\207" [oldpos csp-untabify " " untabify] 3 (#$ . 10418)])
#@94 Return the indent-level the current statement has.
Do not count declarations or definitions.
(defalias 'csp-indent-level #[nil "\212\303\304 \210\305 !\203\306\307\310\311#\210\202)\305\312\n\313Q!\203'\306\314\310\311#\210\202)\315\310w\210i*\207" [re csp-defun-re csp-name-re " " beginning-of-line looking-at search-forward "=" nil t "^[ ]*" "[ ]*:" ":" " ()"] 4 (#$ . 10650)])
#@123 Indent current line as comment.
If optional arg is non-nil, just return the
column number the line should be indented to.
(defalias 'csp-indent-comment #[(&optional arg) "\212\302\303\304\305#\210iT) \203\202\306 \210\307!)\207" [stcol arg re-search-backward "--" nil t delete-horizontal-space csp-indent-to] 4 (#$ . 11049)])
#@38 Indent current lines as declaration.
(defalias 'csp-indent-declaration #[(&optional arg start end) "\306  \206\n?\205\307 ??\205i\n\203\n\202\"\310v\210\311v\210`\312 \203, \2022\313 \210`]\314\223\314\211b\210 \203[`\315 !X\203[\316 \210\317 \210\320 \\!\210\321y\210\202@ \203d\311y\202h\315!b+)\207" [pos arg start end ind edpos point-marker csp-declaration-beg 2 -1 make-marker csp-declaration-end nil marker-position beginning-of-line delete-horizontal-space csp-indent-to 1 stpos csp-indent-level] 5 (#$ . 11388)])
#@41 Indent current line as a csp statement.
(defalias 'csp-indent-line #[(&optional state) "\306 \211@A@ \203 \202\307`\310e`\"\"A@\311 \210 \312=\205(\313 !?\205p \314=\203f\f\203f\315\313!\212\f\204H\316\202L\fb\210i)\203[\317!\202b\317\\!+\202p\317\320\321 \"A!!,\207" [indent-str type ind state branch csp-declaration-re csp-calculate-indent csp-get-branch parse-partial-sexp delete-horizontal-space declaration looking-at block 1 0 csp-indent-to eval assoc nest csp-noindent-re noind ind-levl csp-indent-level csp-indent-alist] 6 (#$ . 11940)])
(defalias 'csp-declaration-beg #[nil "\302\303\212\304 !\210`*\305#\247\207" [csp-declaration-re arg re-search-backward 0 beginning-of-line t] 4])
(defalias 'csp-declaration-end #[nil "\301\212\302\210`)\303#\247\207" [csp-declaration-re re-search-forward 2 t] 4])
(defalias 'csp-within-comment #[nil "\212\301\302\303\212\304!\210`*`\"8)\207" [arg 4 parse-partial-sexp nil beginning-of-line] 4])
(put 'csp-within-comment 'byte-optimizer 'byte-compile-inline-expand)
#@105 Get regexp and position for then- or else-branch pos is in. If it is not in an if-statement return nil.
(defalias 'csp-get-branch #[(pos state) "\306\211\211\211\211A@\203A@\202e\212b\210\307\310\215)\212b\210\311\312!\2032`\2025\307\313\215) \203]\f\203U \fV\203M\314 \202f\312\f\202f\314 \202f\f\203f\312\f\n\203s\212\nb\210\307\315\215) \fF.\207" [state minpos ps ifpos elsepos thenpos nil p (byte-code "\303\304\305 \306#\211\204\307\310\303\"\210\202\n@\311e`\"@U\203\307\310\"\210\202" [res minpos state nil re-search-backward "\\<then\\>" t throw p parse-partial-sexp] 5) looking-at "\\<else\\>" (byte-code "\303\304\305#\211\204\306\307\310\"\210\202\"\n@\311e`\"@U\203\"\306\307 \"\210)\202" [minpos res state re-search-backward "\\<else\\>" t throw p nil parse-partial-sexp] 5) "\\<then\\>" (byte-code "\305\306\307\n\310P \311#\211\204\312\313\305\"\210\202\f@\314e`\"@U\203\315\316!\204/T\202\306U\203=\312\313 \"\210\202S\202" [nest res re minpos state nil 0 re-search-backward "\\|\\<if\\>" t throw p parse-partial-sexp looking-at "\\<if\\>"] 5) re pos] 6 (#$ . 13002)])
#@106 Calculate the indent of the current csp line.
Return a list of two elements: (INDENT-TYPE INDENT-LEVEL).
(defalias 'csp-calculate-indent #[nil "\212\306`\212\307e`\")\310\211\311 \312Q!\311\313!\314\315\316\215\f\310V\2032\317\fD\202K \310V\203FA@b\210\320 D\202K\320 D.\n\207" [parse-sexp-ignore-comments oldpos state nest par csp-declaration-re t parse-partial-sexp 0 looking-at "\\|" "[ ]*else\\>" nil nesting (byte-code "\3068\203\307\310\311\"\210\202U\3128\203\307\310\313\"\210\202U@\314V\203J\315 \"\211A@\2038\316\307\310\317\"\210\202U\320`\321\316#b\210iT\307\310\322\"\210\202U\323\324!\203U\307\310\325\"\210\326\316!\210\323 !\203g\307\310\325\"\210\202U\323!\203\214\212 b\210\321y\210\323\327!)\203\204\307\310\325\"\210\202U\307\310\322\"\210\202U\323!\203\233\307\310\330\"\210\202U\204\257\323!\203\257\307\310\317\"\210\202U\212\331\316!\210\323!)\203\302\332\202Uo\203U\307\310\325\"\210\202U" [state oldpos nestpos nest par comment-start 3 throw nesting string 4 comment 0 csp-get-branch 1 block scan-lists -1 declaration looking-at "--" unknown backward-sexp "^[ ]*$" assertion forward-sexp t csp-declaration-re csp-assert-re complete csp-sub-block-re] 5) contexp csp-indent-level csp-assert-re complete elsed nestpos type] 5 (#$ . 14181)])
#@265 Validate CSP code.
Runs COMMAND, a shell command, in a separate process asynchronously
with output going to the buffer *compilation*.
You can then use the command \[next-error] to find the next error message
and move to the line in the CSP program that caused it.
(defalias 'csp-validate #[(command) "\n\203 \304\305\211\"\210\306\307\310\305 %\207" [command csp-saved-validate-command csp-offer-save csp-validate-error-regexps save-some-buffers nil compile-internal "No more errors" "CSP validation"] 6 (#$ . 15524) (list (read-string "Validate command: " (or csp-saved-validate-command (concat csp-validate-command " " (let ((name (buffer-file-name))) (and name (file-name-nondirectory name)))))))])
#@50 Function called when TAB is pressed in csp mode.
(defalias 'electric-csp-tab #[nil "\212\302\303\304\212\305!\210`*`\"8)\204&\212\306\303\304\212\305!\210`*`\"8)\203)\307 \207 \2038\212\305 \210\310 \210)\202K\212\311\304x\210n)\203H\310 \210\202K\307 \210\312 \207" [arg csp-tab-always-indent 3 parse-partial-sexp nil beginning-of-line 4 csp-insert-tab csp-indent-line " " csp-indent-command] 4 (#$ . 16236) nil])
#@34 Indent for special part of code.
(defalias 'csp-indent-command #[nil "\303 \211@A@ \304=\203\305 \210\306\307!\205\310\311w+\207" [indent-str type ind csp-calculate-indent declaration csp-indent-declaration looking-at "[ ]+$" " " nil] 3 (#$ . 16668)])
#@31 Insert `;' reindent the line.
(defalias 'electric-csp-semi #[nil "c\210\212\302 \210\303 \210) \205\304 \207" [last-command-char csp-auto-newline beginning-of-line csp-indent-line electric-csp-terminate-line] 1 (#$ . 16936) nil])
#@33 Insert ` ->' reindent the line.
(defalias 'electric-csp-arrow #[nil "\301c\210\212\302 \210\303 \210)\205\304 \207" [csp-auto-newline " ->" beginning-of-line csp-indent-line electric-csp-terminate-line] 1 (#$ . 17175) nil])
#@82 Insert arg1 if preceding char is space or TAB, space followed by arg1 otherwise.
(defalias 'csp-generic-insert-op #[(s) "\302\303u\210\304\305!\203 \202\306 P\307u\210c)\207" [ie s nil -1 looking-at "[ ]" " " 1] 2 (#$ . 17408)])
#@34 Insert `[]' at current position.
(defalias 'electric-csp-external-choice #[nil "\300\301!\207" [csp-generic-insert-op "[] "] 2 (#$ . 17652) nil])
#@35 Insert `|~|' at current position.
(defalias 'electric-csp-internal-choice #[nil "\300\301!\207" [csp-generic-insert-op "|~| "] 2 (#$ . 17804) nil])
#@35 Insert `|||' at current position.
(defalias 'electric-csp-interleave #[nil "\300\301!\207" [csp-generic-insert-op "||| "] 2 (#$ . 17958) nil])
#@38 Insert `[| |]' at current position.
(defalias 'electric-csp-sync #[nil "\300\301!\210\302u\207" [csp-generic-insert-op "[| |] " -4] 2 (#$ . 18107) nil])
#@38 Insert `{| |}' at current position.
(defalias 'electric-csp-channel-set #[nil "\300\301!\210\302u\207" [csp-generic-insert-op "{| |} " -4] 2 (#$ . 18268) nil])
#@38 Insert `[[ ]]' at current position.
(defalias 'electric-csp-renaming #[nil "\300\301!\210\302u\207" [csp-generic-insert-op "[[ ]] " -4] 2 (#$ . 18436) nil])
(byte-code "\301\302\"\303\304!\207" [auto-mode-alist append (("\\.csp$" . csp-mode) ("\\.fdr.?$" . csp-mode)) provide csp-mode] 3)
Jump to Line
Something went wrong with that request. Please try again.