Skip to content

Commit

Permalink
core: associate srclocs with generated command ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Feb 6, 2025
1 parent 5c40aed commit c47a61b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion examples/pdf.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
#:exists 'truncate/replace
(lambda ()
(write-bytes data)))

(system* (find-executable-path "open") filename)))))
12 changes: 8 additions & 4 deletions marionette-lib/private/marionette.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,11 @@
(define normalized-name
(string-downcase
(regexp-replace* #rx"[A-Z]+" name:str (λ (s) (~a "-" s)))))

(format-id stx "marionette~a!" (regexp-replace #rx"[^:]*:" normalized-name "")))
(format-id
#;lctx stx
#;fmt "marionette~a!"
#;... (regexp-replace #rx"[^:]*:" normalized-name "")
#:source stx))

(define-syntax-class param
(pattern name:id #:with spec #'name)
Expand All @@ -307,7 +310,8 @@
#`(cons #,key #,name))
(syntax-e #'('param.name ...))
(syntax-e #'(param.name ...)))])
#'(begin
(syntax/loc stx
(begin
(define (name m param.spec ...)
(marionette-send! m
command-name:str
Expand All @@ -318,7 +322,7 @@
[(missing? (cdr pair)) #f]
[else pair]))
(list command-param ...)))))
(provide name)))]))
(provide name))))]))

;; Supported commands can be found here:
;; https://searchfox.org/mozilla-central/source/testing/marionette/driver.js#3570
Expand Down

0 comments on commit c47a61b

Please # to comment.