Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set model directory in the sde causes command #142

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/sde-causes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ let builder = {
}
}
let handler = argv => {
causes(argv.model, argv.varname, argv)
causes(argv.model, argv.c_varname, argv)
}
let causes = (model, varname, opts) => {
// Get the model name and directory from the model argument.
let { modelDirname, modelName, modelPathname } = modelPathProps(model)
let extData = new Map()
let directData = new Map()
let spec = parseSpec(opts.spec)
// Preprocess model text into parser input.
let input = preprocessModel(modelPathname, spec)
// Parse the model to get variable and subscript information.
let parseTree = parseModel(input)
let operation = 'printRefGraph'
codeGenerator(parseTree, { spec, operation, varname }).generate()
codeGenerator(parseTree, { spec, operation, extData, directData, modelDirname, varname }).generate()
}
let parseModel = input => {
// Read the model text and return a parse tree.
Expand Down