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)
|
(cond ((or (fuel-syntax--at-end-of-def)
|
||||||
(fuel-syntax--at-setter-line))
|
(fuel-syntax--at-setter-line))
|
||||||
(fuel-syntax--decreased-indentation))
|
(fuel-syntax--decreased-indentation))
|
||||||
((and (fuel-syntax--at-begin-of-def)
|
((fuel-syntax--at-begin-of-indent-def)
|
||||||
(not (fuel-syntax--at-using)))
|
|
||||||
(fuel-syntax--increased-indentation))
|
(fuel-syntax--increased-indentation))
|
||||||
(t (current-indentation)))))
|
(t (current-indentation)))))
|
||||||
|
|
||||||
|
|
|
@ -132,16 +132,28 @@
|
||||||
|
|
||||||
(defconst fuel-syntax--sub-vocab-regex "^<\\([^ \n]+\\) *$")
|
(defconst fuel-syntax--sub-vocab-regex "^<\\([^ \n]+\\) *$")
|
||||||
|
|
||||||
|
(defconst fuel-syntax--indent-def-starts '("" ":"
|
||||||
|
"FROM"
|
||||||
|
"INTERSECTION:"
|
||||||
|
"M" "MACRO" "MACRO:"
|
||||||
|
"MEMO" "MEMO:" "METHOD"
|
||||||
|
"PREDICATE" "PRIMITIVE"
|
||||||
|
"UNION"))
|
||||||
|
|
||||||
|
(defconst fuel-syntax--no-indent-def-starts '("SINGLETONS"
|
||||||
|
"SYMBOLS"
|
||||||
|
"TUPLE"
|
||||||
|
"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
|
(defconst fuel-syntax--definition-start-regex
|
||||||
(format "^\\(%s:\\) " (regexp-opt '("" ":"
|
(format "^\\(%s:\\) " (regexp-opt (append fuel-syntax--no-indent-def-starts
|
||||||
"FROM"
|
fuel-syntax--indent-def-starts))))
|
||||||
"INTERSECTION:"
|
|
||||||
"MACRO" "MACRO:" "M" "MEMO" "MEMO:" "METHOD"
|
|
||||||
"PREDICATE" "PRIMITIVE"
|
|
||||||
"SINGLETONS" "SYMBOLS"
|
|
||||||
"TUPLE"
|
|
||||||
"UNION"
|
|
||||||
"VARS"))))
|
|
||||||
|
|
||||||
(defconst fuel-syntax--definition-end-regex
|
(defconst fuel-syntax--definition-end-regex
|
||||||
(format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
|
(format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
|
||||||
|
@ -256,6 +268,9 @@
|
||||||
(defsubst fuel-syntax--at-begin-of-def ()
|
(defsubst fuel-syntax--at-begin-of-def ()
|
||||||
(looking-at fuel-syntax--begin-of-def-regex))
|
(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 ()
|
(defsubst fuel-syntax--at-end-of-def ()
|
||||||
(looking-at fuel-syntax--end-of-def-regex))
|
(looking-at fuel-syntax--end-of-def-regex))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue