Skip to content

Commit

Permalink
Better code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Oct 10, 2015
1 parent a2cc73f commit c2105da
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions perl6-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -385,24 +385,25 @@ OPEN-ANGLES is the opening delimiter (e.g. \"«\" or \"<<\")."
(close-angle (matching-paren open-angle))
(quote-beg (- (point) angle-length))
(line-beg (point-at-bol)))
(unless (or (looking-at "[-=]")
(looking-back (rx-to-string `(and (char "+~=!") ,open-angle)) 2))
(when (or (or (not (looking-at "[\s\n]"))
(not (looking-back (rx-to-string `(and (char "\s\n") ,open-angle)) 2)))
(looking-at (rx-to-string `(and ,open-angle (1+ (char "\s\n")) ,close-angle)))
(looking-back (rx-to-string `(and "=" (1+ space) ,open-angle)) line-beg)
(looking-back (rx-to-string `(and "\(" (0+ space) ,open-angle)) line-beg)
(or (looking-at "\s*$")
(looking-back (rx-to-string `(and line-start (0+ space) ,open-angle)) line-beg))
(looking-back (rx-to-string `(and symbol-start (or "enum" "for" "any" "all" "none")
(0+ space) (opt "\)") (0+ space) ,open-angle)) line-beg))
(when
(and (not (or (looking-at "[-=]")
(looking-back (rx-to-string `(and (char "+~=!") ,open-angle)) 2)))
(or (not (looking-at "[\s\n]"))
(not (looking-back (rx-to-string `(and (char "\s\n") ,open-angle)) 2))
(looking-at (rx-to-string `(and ,open-angle (1+ (char "\s\n")) ,close-angle)))
(looking-back (rx-to-string `(and "=" (1+ space) ,open-angle)) line-beg)
(looking-back (rx-to-string `(and "\(" (0+ space) ,open-angle)) line-beg)
(looking-at "\s*$")
(looking-back (rx-to-string `(and line-start (0+ space) ,open-angle)) line-beg)
(looking-back (rx-to-string `(and symbol-start (or "enum" "for" "any" "all" "none")
(0+ space) (opt "\)") (0+ space) ,open-angle)) line-beg)))
(put-text-property quote-beg (1+ quote-beg)
'syntax-table (string-to-syntax "|"))
(perl6-forward-brackets open-angle close-angle angle-length)
(let ((quote-end (- (point) 1)))
(put-text-property quote-beg quote-end 'syntax-multiline t)
(put-text-property quote-end (1+ quote-end)
'syntax-table (string-to-syntax "|"))))))))
'syntax-table (string-to-syntax "|")))))))

(defun perl6-syntax-propertize-backslash ()
(when (eq (perl6-syntax-context) nil)
Expand Down

0 comments on commit c2105da

Please sign in to comment.