Skip to content

Commit

Permalink
Add function to parse orderly script details from AST
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Feb 29, 2024
1 parent 4a060c1 commit 1a64802
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: orderly2
Title: Orderly Next Generation
Version: 1.99.12
Version: 1.99.13
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "[email protected]"),
person("Robert", "Ashton", role = "aut"),
Expand All @@ -11,7 +11,7 @@ Description: Reimplementation of orderly based on outpack.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
URL: https://github.com/mrc-ide/orderly2
BugReports: https://github.com/mrc-ide/orderly2/issues
Imports:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ S3method(format,orderly_query)
S3method(print,orderly_cleanup_status)
S3method(print,orderly_query_explain)
export(orderly_artefact)
export(orderly_build_script_details)
export(orderly_cleanup)
export(orderly_cleanup_status)
export(orderly_config)
Expand Down
16 changes: 16 additions & 0 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ orderly_read <- function(path, call = NULL) {

orderly_read_r <- function(path, entrypoint_filename) {
exprs <- parse(file = path)
orderly_build_script_details(exprs, entrypoint_filename)
}

#' Build the details of an orderly source script
#'
#' Takes the parsed AST from an orderly script, parses details
#' of any calls to orderly_ in-script functions into intermediate
#' representation for downstream use. Also validates calls to
#' orderly_ in-script functions are well-formed.
#'
#' @param exprs Parsed AST from orderly script
#' @param entrypoint_filename Name of entrypoint file to include in metadata
#'
#' @return Details of orderly script
#' @export
orderly_build_script_details <- function(exprs, entrypoint_filename) {

inputs <- list()
artefacts <- list()
Expand Down
22 changes: 22 additions & 0 deletions man/orderly_build_script_details.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a64802

Please sign in to comment.