FUEL: Fix indentation of multiline TUPLE:, SYMBOLS: & similar forms.
parent
093c615dfa
commit
18c2c9cf03
|
@ -144,8 +144,7 @@ code in the buffer."
|
|||
(cond ((or (fuel-syntax--at-end-of-def)
|
||||
(fuel-syntax--at-setter-line))
|
||||
(fuel-syntax--decreased-indentation))
|
||||
((and (fuel-syntax--at-begin-of-def)
|
||||
(not (fuel-syntax--at-using)))
|
||||
((fuel-syntax--at-begin-of-indent-def)
|
||||
(fuel-syntax--increased-indentation))
|
||||
(t (current-indentation)))))
|
||||
|
||||
|
|
|
@ -132,16 +132,28 @@
|
|||
|
||||
(defconst fuel-syntax--sub-vocab-regex "^<\\([^ \n]+\\) *$")
|
||||
|
||||
(defconst fuel-syntax--definition-start-regex
|
||||
(format "^\\(%s:\\) " (regexp-opt '("" ":"
|
||||
(defconst fuel-syntax--indent-def-starts '("" ":"
|
||||
"FROM"
|
||||
"INTERSECTION:"
|
||||
"MACRO" "MACRO:" "M" "MEMO" "MEMO:" "METHOD"
|
||||
"M" "MACRO" "MACRO:"
|
||||
"MEMO" "MEMO:" "METHOD"
|
||||
"PREDICATE" "PRIMITIVE"
|
||||
"SINGLETONS" "SYMBOLS"
|
||||
"UNION"))
|
||||
|
||||
(defconst fuel-syntax--no-indent-def-starts '("SINGLETONS"
|
||||
"SYMBOLS"
|
||||
"TUPLE"
|
||||
"UNION"
|
||||
"VARS"))))
|
||||
"VARS"))
|
||||
|
||||
(defconst fuel-syntax--indent-def-start-regex
|
||||
(format "^\\(%s:\\) " (regexp-opt fuel-syntax--indent-def-starts)))
|
||||
|
||||
(defconst fuel-syntax--no-indent-def-start-regex
|
||||
(format "^\\(%s:\\) " (regexp-opt fuel-syntax--no-indent-def-starts)))
|
||||
|
||||
(defconst fuel-syntax--definition-start-regex
|
||||
(format "^\\(%s:\\) " (regexp-opt (append fuel-syntax--no-indent-def-starts
|
||||
fuel-syntax--indent-def-starts))))
|
||||
|
||||
(defconst fuel-syntax--definition-end-regex
|
||||
(format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
|
||||
|
@ -256,6 +268,9 @@
|
|||
(defsubst fuel-syntax--at-begin-of-def ()
|
||||
(looking-at fuel-syntax--begin-of-def-regex))
|
||||
|
||||
(defsubst fuel-syntax--at-begin-of-indent-def ()
|
||||
(looking-at fuel-syntax--indent-def-start-regex))
|
||||
|
||||
(defsubst fuel-syntax--at-end-of-def ()
|
||||
(looking-at fuel-syntax--end-of-def-regex))
|
||||
|
||||
|
|
Loading…
Reference in New Issue