📄 erlang.el
字号:
"%% Function: end_per_testcase(TestCase, Config) -> _" n "%% Case - atom()" n "%% Name of the test case that is about to be run." n "%% Config - [tuple()]" n "%% A list of key/value pairs, holding the test case configuration." n "%% Description: Cleanup after each test case" n (erlang-skel-separator 2) "end_per_testcase(_TestCase, _Config) ->" n > "ok."n n (erlang-skel-separator 2) "%% Function: all(Clause) -> TestCases" n "%% Clause - atom() - suite | doc" n "%% TestCases - [Case] " n "%% Case - atom()" n "%% Name of a test case." n "%% Description: Returns a list of all test cases in this test suite" n (erlang-skel-separator 2) "all(doc) -> " n > "[\"Describe the main purpose of this suite\"];" n n "all(suite) -> " n > "[]." n n "%% Test cases starts here." n (erlang-skel-separator 2) "test_case(doc) -> " n > "[\"Describe the main purpose of test case\"];" n n "test_case(suite) -> " n > "[];" n n "test_case(Config) when is_list(Config) -> " n > "ok." n ) "*The template of a library module.Please see the function `tempo-define-template'.")(defvar erlang-skel-ct-test-suite '((erlang-skel-include erlang-skel-large-header) "%% Note: This directive should only be used in test suites." n "-compile(export_all)." n n "-include(\"ct.hrl\")." n n "%% Test server callback functions" n (erlang-skel-separator 2) "%% Function: suite() -> Info" n "%% Info - [tuple()]" n "%% List of key/value pairs, default data parameters for the suite." n "%% Description: Return list of tuples to set default data for the suite." n "%%" n "%% Note: The suite/0 function is only meant to be used to return the" n "%% default data list, not perform any other operations." n (erlang-skel-separator 2) "suite() ->" n > "[{timetrap, {minutes, 10}}]." n n (erlang-skel-separator 2) "%% Function: init_per_suite(Config) -> Config" n "%% Config - [tuple()]" n "%% A list of key/value pairs, holding the test case configuration." n "%% Description: Initialization before the whole suite." n "%%" n "%% Note: This function is free to add any key/value pairs to the Config" n "%% variable, but should NOT alter/remove any existing entries." n (erlang-skel-separator 2) "init_per_suite(Config) ->" n > "Config." n n (erlang-skel-separator 2) "%% Function: end_per_suite(Config) -> _" n "%% Config - [tuple()]" n "%% A list of key/value pairs, holding the test case configuration." n "%% Description: Cleanup after the whole suite." n (erlang-skel-separator 2) "end_per_suite(_Config) ->" n > "ok." n n (erlang-skel-separator 2) "%% Function: init_per_testcase(TestCase, Config) -> Config" n "%% TestCase - atom()" n "%% Name of the test case that is about to be run." n "%% Config - [tuple()]" n "%% A list of key/value pairs, holding the test case configuration." n "%% Description: Initialization before each test case." n "%%" n "%% Note: This function is free to add any key/value pairs to the Config" n "%% variable, but should NOT alter/remove any existing entries." n (erlang-skel-separator 2) "init_per_testcase(_TestCase, Config) ->" n > "Config." n n (erlang-skel-separator 2) "%% Function: end_per_testcase(TestCase, Config) -> _" n "%% TestCase - atom()" n "%% Name of the test case that is about to be run." n "%% Config - [tuple()]" n "%% A list of key/value pairs, holding the test case configuration." n "%% Description: Cleanup after each test case." n (erlang-skel-separator 2) "end_per_testcase(_TestCase, _Config) ->" n > "ok."n n (erlang-skel-separator 2) "%% Function: all() -> TestCases" n "%% TestCases - [Case] " n "%% Case - atom()" n "%% Name of a test case." n "%% Description: Returns a list of all test cases in this test suite." n (erlang-skel-separator 2) "all() -> " n > "[]." n n "%% Test cases start here." n (erlang-skel-separator 2) "test_case() -> " n > "[]." n n "test_case(Config) when is_list(Config) -> " n > "ok." n ) "*The template of a library module.Please see the function `tempo-define-template'.");; Font-lock variables(defvar erlang-font-lock-modern-p (cond ((>= erlang-emacs-major-version 20) t) (erlang-xemacs-p (>= erlang-emacs-minor-version 14)) ((= erlang-emacs-major-version 19) (>= erlang-emacs-minor-version 29)) (t nil)) "Non-nil when this version of Emacs uses a modern version of Font Lock.This is determined by checking the version of Emacs used, the actualfont-lock code is not loaded.");; The next few variables define different Erlang font-lock patterns.;; They could be appended to form a custom font-lock appearance.;;;; The function `erlang-font-lock-set-face' could be used to change;; the face of a pattern.;;;; Note that Erlang strings and atoms are highlighted with using;; syntactic analysis.(defvar erlang-font-lock-keywords-func (list (list (concat "^" erlang-atom-regexp "\\s *(") 1 'font-lock-function-name-face t)) "Font lock keyword highlighting a function header.")(defvar erlang-font-lock-keywords-dollar (list (list "\\(\\$\\([^\\]\\|\\\\\\([^0-7^\n]\\|[0-7]+\\|\\^[a-zA-Z]\\)\\)\\)" 1 'font-lock-string-face)) "Font lock keyword highlighting numbers in ASCII form (e.g. $A).")(defvar erlang-font-lock-keywords-arrow (list (list "\\(->\\|:-\\)\\(\\s \\|$\\)" 2 'font-lock-function-name-face)) "Font lock keyword highlighting clause arrow.")(defvar erlang-font-lock-keywords-lc (list (list "\\(<-\\)\\(\\s \\|$\\)" 1 'font-lock-keyword-face) (list "\\(||\\)\\(\\s \\|$\\)" 1 'font-lock-keyword-face)) "Font lock keyword highlighting list comprehension operators.")(defvar erlang-font-lock-keywords-keywords (list (list (concat "\\<\\(a\\(fter\\|ndalso\\)\\|begin\\|c\\(atch\\|ase\\)" "\\|end\\|fun\\|if\\|o\\(f\\|relse\\)\\|receive\\|try\\|when" "\\|query\\)\\([^a-zA-Z0-9_]\\|$\\)") 1 'font-lock-keyword-face)) "Font lock keyword highlighting Erlang keywords.")(defvar erlang-font-lock-keywords-attr (list (list (concat "^\\(-" erlang-atom-regexp "\\)\\s *\\(\\.\\|(\\)") 1 'font-lock-function-name-face)) "Font lock keyword highlighting attributes.")(defvar erlang-font-lock-keywords-quotes (list (list "`\\([-+a-zA-Z0-9_:*][-+a-zA-Z0-9_:*]+\\)'" 1 (if erlang-font-lock-modern-p 'font-lock-reference-face 'font-lock-keyword-face) t)) "Font lock keyword highlighting words in single quotes in comments.This is not the highlighting of Erlang strings and atoms, whichare highlighted by syntactic analysis.");; Note: The guard `float' collides with the bif `float'.(defvar erlang-font-lock-keywords-guards (list (list (concat "\\<\\(" "\\(is_\\)*\\(atom\\|boolean\\|function\\|binary\\|constant" "\\|float\\|integer\\|list\\|number\\|p\\(id\\|ort\\)\\|" "re\\(ference\\|cord\\)\\|tuple" "\\)\\)\\s *(") 1 (if erlang-font-lock-modern-p 'font-lock-reference-face 'font-lock-keyword-face))) "Font lock keyword highlighting guards.")(defvar erlang-font-lock-keywords-bifs (list (list (concat "\\<\\(" "a\\(bs\\|live\\|pply\\|tom_to_list\\)\\|" "binary_to_\\(list\\|term\\)\\|" "concat_binary\\|d\\(ate\\|isconnect_node\\)\\|" "e\\(lement\\|rase\\|xit\\)\\|" "float\\(\\|_to_list\\)\\|" "g\\(arbage_collect\\|et\\(\\|_keys\\)\\|roup_leader\\)\\|" "h\\(alt\\|d\\)\\|" "i\\(nte\\(ger_to_list\\|rnal_bif\\)\\|s_alive\\)\\|" "l\\(ength\\|i\\(nk\\|st_to_\\(atom\\|binary\\|float\\|integer" "\\|pid\\|tuple\\)\\)\\)\\|" "make_ref\\|no\\(de\\(\\|_\\(link\\|unlink\\)\\|s\\)\\|talive\\)\\|" "open_port\\|" "p\\(id_to_list\\|rocess\\(_\\(flag\\|info\\)\\|es\\)\\|ut\\)\\|" "r\\(egister\\(\\|ed\\)\\|ound\\)\\|" "s\\(e\\(lf\\|telement\\)\\|ize\\|" "p\\(awn\\(\\|_link\\)\\|lit_binary\\)\\|tatistics\\)\\|" "t\\(erm_to_binary\\|hrow\\|ime\\|l\\|" "r\\(ace\\|unc\\)\\|uple_to_list\\)\\|" "un\\(link\\|register\\)\\|whereis" "\\)\\s *(") 1 'font-lock-keyword-face)) "Font lock keyword highlighting built in functions.")(defvar erlang-font-lock-keywords-macros (list (list (concat "?\\s *\\(" erlang-atom-regexp "\\|" erlang-variable-regexp "\\)\\>") 1 (if erlang-font-lock-modern-p 'font-lock-reference-face 'font-lock-type-face)) (list (concat "^-\\(define\\|ifn?def\\)\\s *(\\s *\\(" erlang-atom-regexp "\\|" erlang-variable-regexp "\\)\\>") 2 (if erlang-font-lock-modern-p 'font-lock-reference-face 'font-lock-type-face))) "Font lock keyword highlighting macros.This must be placed in front of `erlang-font-lock-keywords-vars'.")(defvar erlang-font-lock-keywords-records (list (list (concat "#\\s *" erlang-atom-regexp "\\>") 1 'font-lock-type-face) ;; Don't highlight numerical constants. (list "\\<[0-9][0-9]?#\\([0-9a-fA_F]+\\)\\>" 1 nil t) (list (concat "^-record(\\s *" erlang-atom-regexp "\\>") 1 'font-lock-type-face)) "Font lock keyword highlighting Erlang records.This must be placed in front of `erlang-font-lock-keywords-vars'.")(defvar erlang-font-lock-keywords-vars (list (list (concat "\\<" erlang-variable-regexp "\\>") 1 (if erlang-font-lock-modern-p 'font-lock-variable-name-face 'font-lock-type-face))) "Font lock keyword highlighting Erlang variables.Must be preceded by `erlang-font-lock-keywords-macros' and `-records'to work properly.")(defvar erlang-font-lock-keywords-1 (append erlang-font-lock-keywords-func erlang-font-lock-keywords-dollar erlang-font-lock-keywords-arrow erlang-font-lock-keywords-keywords) ;; DocStringOrig: erlang-font-lock-keywords "Font-lock keywords used by Erlang Mode.There exists three levels of Font Lock keywords for Erlang: `erlang-font-lock-keywords-1' - Function headers and reserved keywords. `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. `erlang-font-lock-keywords-3' - Variables, macros and records.To use a specific level, please set the variable`font-lock-maximum-decoration' to the appropriate level. Note that thevariable must be set before Erlang mode is activated.Example: (setq font-lock-maximum-decoration 2)")(defvar erlang-font-lock-keywords-2 (append erlang-font-lock-keywords-1 erlang-font-lock-keywords-attr erlang-font-lock-keywords-quotes erlang-font-lock-keywords-guards erlang-font-lock-keywords-bifs) ;; DocStringCopy: erlang-font-lock-keywords "Font-lock keywords used by Erlang Mode.There exists three levels of Font Lock keywords for Erlang: `erlang-font-lock-keywords-1' - Function headers and reserved keywords. `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. `erlang-font-lock-keywords-3' - Variables, macros and records.To use a specific level, please set the variable`font-lock-maximum-decoration' to the appropriate level. Note that thevariable must be set before Erlang mode is activated.Example: (setq font-lock-maximum-decoration 2)")(defvar erlang-font-lock-keywords-3 (append erlang-font-lock-keywords-2 erlang-font-lock-keywords-macros erlang-font-lock-keywords-records erlang-font-lock-keywords-vars) ;; DocStringCopy: erlang-font-lock-keywords "Font-lock keywords used by Erlang Mode.There exists three levels of Font Lock keywords for Erlang: `erlang-font-lock-keywords-1' - Function headers and reserved keywords. `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. `erlang-font-lock-keywords-3' - Variables, macros and records.To use a specific level, please set the variable`font-lock-maximum-decoration' to the appropriate level. Note that thevariable must be set before Erlang mode is activated.Example: (setq font-lock-maximum-decoration 2)")(defvar erlang-font-lock-keywords erlang-font-lock-keywords-3 ;; DocStringCopy: erlang-font-lock-keywords "Font-lock keywords used by Erlang Mode.There exists three levels of Font Lock keywords for Erlang: `erlang-font-lock-keywords-1' - Function headers and reserved keywords. `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. `erlang-font-lock-k
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -