Files
emacsd/elpa/ssass-mode-20190521.249/ssass-mode.elc

78 lines
8.9 KiB
Plaintext
Raw Normal View History

2019-12-01 19:55:19 +01:00
;ELC
;;; Compiled
;;; in Emacs version 26.3
;;; with all optimizations.
;;; This file contains utf-8 non-ASCII characters,
;;; and so cannot be loaded into Emacs 22 or earlier.
(and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(string-lessp emacs-version "23")
(error "`%s' was compiled for Emacs 23 or later" #$))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(custom-declare-group 'ssass nil "Major mode for Sass files" :prefix "ssass-" :group 'languages :link '(url-link :tag "Github" "https://github.com/AdamNiederer/ssass-mode") :link '(emacs-commentary-link :tag "Commentary" "ssass-mode"))
(defconst ssass-id-regex "#[a-z][A-Za-z0-9-]+")
(defconst ssass-class-regex "\\.[a-z][A-Za-z0-9-]+")
(defconst ssass-pseudoselector-regex "::?[A-Za-z0-9-]+")
(defconst ssass-key-regex "^ +[a-z-]+:")
#@58 Matches all directives which do not require indentation.
(defconst ssass-directive-noindent-regex "@\\(include\\|extend\\|import\\|warn\\|debug\\|error\\)" (#$ . 843))
(defconst ssass-variable-regex "$[A-Za-z0-9-]+")
(defconst ssass-variable-assignment-regex (concat ssass-variable-regex ":"))
(defconst ssass-builtin-regex "@[A-Za-z]+")
(defconst ssass-comment-regex "^ +/[/*].*")
(defconst ssass-function-regex "\\([A-Za-z-]+?\\)\\((.*)\\)")
(defconst ssass-keywords '("and" "or" "not" "in" "from" "to" "through"))
(defconst ssass-control-directives '("@if" "@else" "@each" "@for"))
(defconst ssass-function-directives '("@function" "@return"))
(defconst ssass-mixin-directives '("@mixin" "@include"))
(defconst ssass-constants '("true" "false" "null"))
(defconst ssass-bang-regex "![a-z][A-Za-z0-9]+")
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\313&\210\300\314\315\316\304\305\306\317&\210\300\320\321\322\304\305\306\317&\210\300\323\324\325\304\305\306\313&\207" [custom-declare-variable ssass-tab-width 2 "Tab width for ssass-mode." :group ssass :type integer ssass-indent-blanks t "Whether to indent blank lines." boolean ssass-compiler "sassc" "Sass compiler for `ssass-eval-region' and `ssass-eval-buffer'." string ssass-opt "--sass" "Options for `ssass-compiler'.\n\nUse --sass for sassc, and --indented-syntax for node-sass." ssass-color-keys nil "(TODO) Whether to color proprty names."] 8)
#@29 List of Font Lock keywords.
(defconst ssass-font-lock-keywords (byte-code "\306B \307B\n\310B \311B\f\312B \313B\314B\315B\316\317\"\320B\316\317\"\320B\316\317\"\320B\316\317\"\321B\257\f\207" [ssass-id-regex ssass-class-regex ssass-key-regex ssass-function-regex ssass-builtin-regex ssass-pseudoselector-regex (0 font-lock-keyword-face) (0 font-lock-type-face) (0 font-lock-variable-name-face) (1 font-lock-function-name-face) (0 font-lock-builtin-face) (0 font-lock-function-name-face) (0 font-lock-variable-name-face) (0 font-lock-warning-face) regexp-opt words font-lock-keyword-face font-lock-constant-face ssass-variable-regex ssass-bang-regex ssass-keywords ssass-control-directives ssass-function-directives ssass-constants] 14) (#$ . 2299))
#@30 Keymap for ssass-mode.
(defvar ssass-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210)\207" [map make-keymap define-key [backtab] ssass-dedent "" ssass-eval-buffer "" ssass-eval-region] 4) (#$ . 3069))
#@36 Return whether LINE is a selector.
(defalias 'ssass--selector-p #[(line) "\211\306\230\262\206F \307\310\311#)\266\203\206F \307\310\311#)\266\203\206F\f\307\310\311#)\266\203\206F \307\310\311#)\266\203?\207" [line ssass-key-regex inhibit-changing-match-data ssass-variable-assignment-regex ssass-directive-noindent-regex ssass-comment-regex "" nil t string-match] 7 (#$ . 3321)])
#@78 Move point to the line of the last selector, or the beginning of the buffer.
(defalias 'ssass--goto-last-anchor-line #[nil "\300y\210e\301 \232\206\302\301 \303 {!?\205\300y\210\202\207" [-1 point-at-bol ssass--selector-p point-at-eol] 3 (#$ . 3735)])
#@70 Return the number of spaces indenting the line of the last selector.
(defalias 'ssass--last-anchor-line-indent-level #[nil "\212\300 \210\301 )\207" [ssass--goto-last-anchor-line ssass--indent-level] 1 (#$ . 3999)])
#@57 Return the number of spaces indenting the current line.
(defalias 'ssass--indent-level #[nil "\212\300 \210i)\212\301 \210i)Z\207" [back-to-indentation beginning-of-line] 2 (#$ . 4221)])
#@82 Return whether the line at offset from point LINE consists solely of whitespace.
(defalias 'ssass--whitespace-p #[(line) "\212y\210\302\303 \304 {\305\306\307#)\266\203)\207" [line inhibit-changing-match-data "^[[:space:]]*$" point-at-bol point-at-eol nil t string-match] 7 (#$ . 4414)])
#@58 Return whether the previous line has a comma at its end.
(defalias 'ssass--comma-before-p #[nil "\212\301y\210\302\303 \304 {\305\306\307#)\266\203)\207" [inhibit-changing-match-data -1 ",\\s-*$" point-at-bol point-at-eol nil t string-match] 7 (#$ . 4713)])
#@72 Return whether there is no proper selector or keyword above this line.
(defalias 'ssass--no-anchor-line-p #[nil "\212\300 \210\301\302 \303 {!)?\207" [ssass--goto-last-anchor-line ssass--selector-p point-at-bol point-at-eol] 3 (#$ . 4981)])
#@26 Indent the current line.
(defalias 'ssass-indent #[nil "\302\204\303\304!\203\304\2020\303\305!\203\304\2020\306 \203\"\304\2020\307 \203,\310 \2020 \310 \\!\207" [ssass-indent-blanks ssass-tab-width indent-line-to ssass--whitespace-p 0 -1 ssass--no-anchor-line-p ssass--comma-before-p ssass--last-anchor-line-indent-level] 3 (#$ . 5228) nil])
#@56 Remove one level of indentation from the current line.
(defalias 'ssass-dedent #[nil "\301\302\303 Z]!\207" [ssass-tab-width indent-line-to 0 ssass--indent-level] 4 (#$ . 5591) nil])
#@136 Run the given file through sass, and display the output in another window.
If FILENAME is nil, it will open the current buffer's file
(defalias 'ssass-eval-file #[(&optional filename) "\303\304\305!!\203\f\306\305!\210\307\310\305 \n\206\311 %\210\312\305!\210\313 \207" [ssass-compiler ssass-opt filename buffer-live-p get-buffer "*sass*" kill-buffer start-process "sass" buffer-file-name switch-to-buffer-other-window special-mode] 6 (#$ . 5782) nil])
#@88 Run the region from BEG to END through sass, and display the output in another window.
(defalias 'ssass-eval-region #[(beg end) "\303\304\305\306#\307 \n\305\211\211\211&\210\310!\210\311!)\207" [tmp-file beg end make-temp-file "sass-eval" nil ".sass" write-region ssass-eval-file delete-file] 8 (#$ . 6247) "r"])
#@80 Run the current buffer through sass, and display the output in another window.
(defalias 'ssass-eval-buffer #[nil "\300ed\"\207" [ssass-eval-region] 3 (#$ . 6572) nil])
(defvar ssass-mode-hook nil)
(byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [ssass-mode-hook variable-documentation put "Hook run after entering Ssass mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp ssass-mode-map definition-name ssass-mode] 4)
(defvar ssass-mode-map (make-sparse-keymap))
(byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [ssass-mode-abbrev-table ssass-mode-map variable-documentation put purecopy "Keymap for `ssass-mode'." boundp ssass-mode-syntax-table definition-name ssass-mode (lambda (#1=#:def-tmp-var) (defvar ssass-mode-syntax-table #1#)) make-syntax-table "Syntax table for `ssass-mode'." (lambda (#1#) (defvar ssass-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `ssass-mode'." derived-mode-parent prog-mode] 5)
#@209 Major mode for Sass
In addition to any hooks its parent mode `prog-mode' might have run,
this mode runs the hook `ssass-mode-hook', as the final or penultimate step
during initialization.
\{ssass-mode-map}
(defalias 'ssass-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324(\325\"\204V()=\204V\326(\325)C#\210\327 !\210\330\f!\210()\306\331!\210\332\306\333!\210*\306\334!\210\335\336\332+\"\210\337\340\341\f#\210\337\342\343\f#\210\337\344\345\f#\210)\346\347!\207" [delay-mode-hooks major-mode mode-name ssass-mode-map ssass-mode-syntax-table parent make-local-variable t prog-mode ssass-mode "Ssass" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table electric-indent-mode nil tab-width indent-line-function ssass-indent font-lock-add-keywords modify-syntax-entry 47 ". 124" 42 ". 23b" 10 ">" run-mode-hooks ssass-mode-hook ssass-mode-abbrev-table local-abbrev-table ssass-tab-width ssass-font-lock-keywords] 6 (#$ . 7871) nil])
(provide 'ssass-mode)