branch: elpa/dockerfile-mode
commit 97733ce074b1252c1270fd5e8a53d178b66668ed
Author: Masanari Mizuno <[email protected]>
Commit: Drew Csillag <[email protected]>
Support FROM --platform= in font-lock and imenu
---
dockerfile-mode.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dockerfile-mode.el b/dockerfile-mode.el
index 06162e7bf54..fc62da39c43 100644
--- a/dockerfile-mode.el
+++ b/dockerfile-mode.el
@@ -110,7 +110,14 @@ It is supported from docker 18.09"
"Face to highlight the base image alias inf FROM ... AS <alias> construct.")
(defconst dockerfile--from-regex
- (rx "from " (group (+? nonl)) (or (1+ " ") eol) (? "as " (group (1+ nonl)))))
+ (rx line-start (* blank) "from" (+ blank)
+ (? "--platform=" (+ (not (any blank "\n"))) (+ blank))
+ (group (+ (not (any blank "\n"))))
+ (* blank)
+ (? "as" (+ blank) (group (+ (not (any blank "\n")))))
+ (* blank)
+ (? "#" (* nonl))
+ line-end))
(defvar dockerfile-font-lock-keywords
`(,(cons (rx (or line-start "onbuild ")