Skip to content

Commit ac369ab

Browse files
authored
Merge branch 'main' into vectorInteg
2 parents f85552a + 795898c commit ac369ab

File tree

211 files changed

+1978
-1884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+1978
-1884
lines changed

.github/ISSUE_TEMPLATE/tmpltMeetIssue.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
---
22
name: Drasil Meeting
33
about: Create an agenda for Drasil team meetings and to track details.
4-
title: 'Drasil Team Meeting - Tuesday, Date, 1:30 pm, ITB/225'
4+
title: 'Drasil Team Meeting - Tuesday, Date, 1:30 pm, ITB/112'
55
labels: 'meeting'
66
assignees:
77
- balacij
88
- JacquesCarette
99
- smiths
1010
- sarrasoussia
11-
- jackwyand
11+
- B-rando1
12+
- Xinlu-Y
13+
- JoeZZG
14+
1215

1316
---
1417

1518
**Agenda**
1619

1720
1. Blockers for @sarrasoussia
18-
19-
2. Blockers for @jackwyand
21+
2. Blockers for @B-rando1
22+
3. Blockers for @Xinlu-Y
23+
4. Blockers for @JoeZZG
2024

2125
Regrets:
2226

.github/workflows/Build.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
stack-version: 'latest'
6666

6767
- name: "Cache dependencies"
68-
uses: actions/cache@v4.2.4
68+
uses: actions/cache@v4.3.0
6969
with:
7070
path: |
7171
~/.stack
@@ -127,6 +127,12 @@ jobs:
127127
run: make mdbook_build
128128
if: ${{ steps.changes.outputs.md == 'true' || fromJSON(env.is_deployment) }}
129129

130+
- name: "Extract HTML copies of Jupyter Notebooks"
131+
run: |
132+
sudo apt-get install -y --fix-missing jupyter
133+
make jupyter_html
134+
if: ${{ steps.changes.outputs.md == 'true' || fromJSON(env.is_deployment) }}
135+
130136
- name: "Build website generator"
131137
run: make website
132138

.github/workflows/Lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
if: ${{ steps.filter.outputs.hs == 'true' }}
3535
uses: haskell-actions/hlint-setup@v2
3636
with: # DO NOT MODIFY THE BELOW LINE MANUALLY -- code/scripts/update_default_stackage.sh is in charge of this!
37-
version: '3.6.1' # HLINT VERSION TIED TO CURRENT TARGET (LTS-22.31)
37+
version: '3.6.1' # HLINT VERSION TIED TO CURRENT TARGET (LTS-22.44)
3838

3939
- name: 'Run HLint'
4040
if: ${{ steps.filter.outputs.hs == 'true' }}

CITATION.cff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,7 @@ authors:
105105
given-names: Brandon
106106
email: "brandobosman@gmail.com"
107107
website: "https://github.com/B-rando1"
108+
- family-names: Wyand
109+
given-names: Jack
110+
email: "wyandj@mcmaster.ca"
111+
website: "https://github.com/jackwyand"

code/Makefile

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ INSTALL_E_SUFFIX = _install
7878
DEBUG_E_SUFFIX = _debug
7979
MDBOOK_BUILD_E_SUFFIX = _mdbook_build
8080
MDBOOK_SERVER_E_SUFFIX = _mdbook_server
81+
JUPYTER_HTML_E_SUFFIX = _juphtml
8182

8283
# add example names with the appropriate suffixes to create per-example targets
8384
GEN_EXAMPLES = $(addsuffix $(GEN_E_SUFFIX), $(EXAMPLES))
@@ -92,6 +93,7 @@ INSTALL_EXAMPLES = $(addsuffix $(INSTALL_E_SUFFIX), $(EXAMPLES))
9293
DEBUG_EXAMPLES = $(addsuffix $(DEBUG_E_SUFFIX), $(EXAMPLES))
9394
MDBOOK_BUILD_EXAMPLES = $(addsuffix $(MDBOOK_BUILD_E_SUFFIX), $(EXAMPLES))
9495
MDBOOK_SERVER_EXAMPLES = $(addsuffix $(MDBOOK_SERVER_E_SUFFIX), $(EXAMPLES))
96+
JUPYTER_HTML_EXAMPLES = $(addsuffix $(JUPYTER_HTML_E_SUFFIX), $(EXAMPLES))
9597

9698
# Website names with appropriate suffixes.
9799
TEST_WEBSITE = $(addsuffix $(TEST_E_SUFFIX), $(WEBSITE_FOLDER_NAME))
@@ -113,6 +115,14 @@ ALL_EXPANDED_TARGETS = $(foreach P, $(PACKAGE_GEN_TARGET), $($(P)_PACKAGES)) $(f
113115

114116
# make variables/configuration
115117
DIFF = diff --strip-trailing-cr -r -X ../.gitignore --exclude='*.prof' --exclude='.drasil' # Excludes are to ignore the data the 'debug'-related targets generate.
118+
DIFF_PREFIX ?=
119+
120+
# Run diff and capture both stdout and stderr into a log file. Redirecting
121+
# stderr to stdout to populate logs when issues with performing the diff occurs
122+
# (e.g., when `stable/` does not exist).
123+
# $1: stable path, $2: build path, $3: log path
124+
DO_DIFF = $(DIFF_PREFIX)$(DIFF) "$1" "$2" > "$3" 2>&1
125+
116126
LOG_SUFFIX = _log.log
117127
MIN_STACK_VER = 2.3.1 # Match stack.yaml see PR #2142 for more info.
118128
CACHED_MSV_FILE = .drasil-min-stack-ver
@@ -241,12 +251,15 @@ examples: $(GEN_EXAMPLES) ##@Examples Run all examples (no traceability graphs).
241251
# First build all the Drasil packages, then run all examples and generate graphs for them.
242252
tracegraphs: $(TRACE_GRAPH_EXAMPLES) ##@Examples Run examples with traceability graphs.
243253

244-
# First build all the Drasil packages, run all examples (no traceability graphs),
245-
# and then test the generated contents with those in the stable folder.
246-
test: $(TEST_EXAMPLES) ##@Examples Run all examples and compare against the stable folder examples.
247-
@echo ----------------------------
248-
@echo Make complete, checking logs
249-
@echo ----------------------------
254+
# Build all the Drasil packages (via 'code' dep.), run all examples, and then
255+
# test generated artifacts with stable/. Defer 'diff' exit codes to the log
256+
# checking script.
257+
test: code ##@Examples Test examples en masse against stable, only failing at the end if there were diffs.
258+
@echo "Running tests (ignoring diff exit codes)..."
259+
@$(MAKE) DIFF_PREFIX=- $(TEST_EXAMPLES)
260+
@echo ---------------------------------------
261+
@echo Tests complete, checking logs
262+
@echo ---------------------------------------
250263
@LOG_FOLDER="$(LOG_FOLDER)" LOG_SUFFIX="$(LOG_SUFFIX)" NOISY=$(NOISY) "$(SHELL)" "$(SCRIPT_FOLDER)log_check.sh"
251264

252265
# First builds the website and then tests the generated contenst with those in
@@ -287,15 +300,17 @@ packagedeps: graphmod check_dot
287300
# and then build the generated mdBook projects.
288301
mdbook_build: $(MDBOOK_BUILD_EXAMPLES) ##@Examples Build all generated mdBook projects.
289302

303+
jupyter_html: $(JUPYTER_HTML_EXAMPLES) ##@Examples Extract HTML copies from all Jupyter SRS Notebooks.
304+
290305
#--------------------------------------------------------------#
291306
#--- Targets that are used for individual packages/examples ---#
292307
#--------------------------------------------------------------#
293308
# Use filter to make a target for every package (second argument of filter)
294309
# with an appended suffix (first argument of filter).
295310

296311
# Variables needed to create individual example targets using filter.
297-
%$(GEN_E_SUFFIX) %$(TEST_E_SUFFIX) %$(STABILIZE_E_SUFFIX) %$(BC_E_SUFFIX) %$(TRACE_GRAPH_SUFFIX) %$(INSTALL_E_SUFFIX) %$(MDBOOK_BUILD_E_SUFFIX) %$(MDBOOK_SERVER_E_SUFFIX): EXAMPLE=$(shell echo $* | tr a-z A-Z)
298-
%$(GEN_E_SUFFIX) %$(TEST_E_SUFFIX) %$(STABILIZE_E_SUFFIX) %$(BC_E_SUFFIX) %$(TRACE_GRAPH_SUFFIX) %$(INSTALL_E_SUFFIX) %$(MDBOOK_BUILD_E_SUFFIX) %$(MDBOOK_SERVER_E_SUFFIX): EDIR=$($(EXAMPLE)_DIR)
312+
%$(GEN_E_SUFFIX) %$(TEST_E_SUFFIX) %$(STABILIZE_E_SUFFIX) %$(BC_E_SUFFIX) %$(TRACE_GRAPH_SUFFIX) %$(INSTALL_E_SUFFIX) %$(MDBOOK_BUILD_E_SUFFIX) %$(MDBOOK_SERVER_E_SUFFIX) %$(JUPYTER_HTML_E_SUFFIX): EXAMPLE=$(shell echo $* | tr a-z A-Z)
313+
%$(GEN_E_SUFFIX) %$(TEST_E_SUFFIX) %$(STABILIZE_E_SUFFIX) %$(BC_E_SUFFIX) %$(TRACE_GRAPH_SUFFIX) %$(INSTALL_E_SUFFIX) %$(MDBOOK_BUILD_E_SUFFIX) %$(MDBOOK_SERVER_E_SUFFIX) %$(JUPYTER_HTML_E_SUFFIX): EDIR=$($(EXAMPLE)_DIR)
299314
%$(GEN_E_SUFFIX) %$(TRACE_GRAPH_SUFFIX) %$(INSTALL_E_SUFFIX): EEXE=$($(EXAMPLE)_EXE)
300315

301316
# Build individual Drasil packages. Each package will have the target packageName_build.
@@ -313,15 +328,15 @@ $(filter %$(GEN_E_SUFFIX), $(GEN_EXAMPLES)): %$(GEN_E_SUFFIX):
313328

314329
# Compiles GOOL examples to concrete code (Java, C++, etc.)
315330
$(GOOLTEST)$(GEN_E_SUFFIX):
316-
- rm -rf "$(BUILD_FOLDER)$(GOOLTEST_DIR)"
331+
rm -rf "./$(BUILD_FOLDER)$(GOOLTEST_DIR)"
317332
stack build $(stackArgs) "drasil-code:exe:$(GOOLTEST_EXE)"
318333
@mkdir -p "$(BUILD_FOLDER)$(GOOLTEST_DIR)"
319334
cd "$(BUILD_FOLDER)$(GOOLTEST_DIR)" && $(STACK_EXEC) -- "$(GOOLTEST_EXE)"
320335

321336

322337
$(GOOLTEST)$(TEST_E_SUFFIX): $(GOOLTEST)$(GEN_E_SUFFIX) $(CLEAN_GF_PREFIX)$(LOG_FOLDER_NAME)
323338
@mkdir -p "$(LOG_FOLDER)"
324-
- $(DIFF) "$(STABLE_FOLDER)$(GOOLTEST_DIR)/" "$(BUILD_FOLDER)$(GOOLTEST_DIR)/" > "$(LOG_FOLDER)$(GOOLTEST_DIR)$(LOG_SUFFIX)"
339+
$(call DO_DIFF,$(STABLE_FOLDER)$(GOOLTEST_DIR)/,$(BUILD_FOLDER)$(GOOLTEST_DIR)/,$(LOG_FOLDER)$(GOOLTEST_DIR)$(LOG_SUFFIX))
325340
@LOG_FOLDER="$(LOG_FOLDER)" LOG_SUFFIX="$(LOG_SUFFIX)" NOISY=$(NOISY) "$(SHELL)" "$(SCRIPT_FOLDER)log_check.sh"
326341

327342
# Install individual Drasil examples
@@ -350,41 +365,44 @@ $(filter %$(TRACE_GRAPH_SUFFIX), $(TRACE_GRAPH_EXAMPLES)): %$(TRACE_GRAPH_SUFFIX
350365
# to those in the stable folder. Targets will have the form exampleName_diff.
351366
$(filter %$(TEST_E_SUFFIX), $(TEST_EXAMPLES)): %$(TEST_E_SUFFIX): $(CLEAN_GF_PREFIX)$(LOG_FOLDER_NAME) %$(GEN_E_SUFFIX)
352367
@mkdir -p "$(LOG_FOLDER)"
353-
- $(DIFF) "$(STABLE_FOLDER)$*/" "$(BUILD_FOLDER)$(EDIR)/" > "$(LOG_FOLDER)$(EDIR)$(LOG_SUFFIX)"
368+
$(call DO_DIFF,$(STABLE_FOLDER)$*/,$(BUILD_FOLDER)$(EDIR)/,$(LOG_FOLDER)$(EDIR)$(LOG_SUFFIX))
354369

355370
# Website diff tests. First builds the website and then compares the generated
356371
# contents in the Website folder to those in the stable-website folder.
357372
# Target will have the form Website_diff.
358373
$(filter %$(TEST_E_SUFFIX), $(TEST_WEBSITE)): %$(TEST_E_SUFFIX): $(CLEAN_GF_PREFIX)$(LOG_FOLDER_NAME) website
359374
@mkdir -p "$(LOG_FOLDER)"
360-
- $(DIFF) "$(STABLE_WEBSITE_FOLDER)" "$(WEBSITE_FOLDER)" > "$(LOG_FOLDER)$(WEBSITE_FOLDER_NAME)$(LOG_SUFFIX)"
375+
$(call DO_DIFF,$(STABLE_WEBSITE_FOLDER),$(WEBSITE_FOLDER),$(LOG_FOLDER)$(WEBSITE_FOLDER_NAME)$(LOG_SUFFIX))
361376

362377
# Individual example build cleans. Removes a specific example from the build folder.
363378
# Targets will have the form exampleName_build_clean.
364379
$(filter %$(BC_E_SUFFIX), $(BC_EXAMPLES)): %$(BC_E_SUFFIX):
365-
- rm -rf "$(BUILD_FOLDER)$(EDIR)"
380+
rm -rf "./$(BUILD_FOLDER)$(EDIR)"
366381

367382
# The website build cleans.
368383
# Target will have the form Website_build_clean
369384
$(filter %$(BC_E_SUFFIX), $(BC_WEBSITE)): %$(BC_E_SUFFIX):
370-
- rm -rf "$(WEBSITE_FOLDER)"
385+
rm -rf "./$(WEBSITE_FOLDER)"
371386

372387
# Individual example stabilization. First builds all Drasil packages,
373388
# runs all examples, and then copies contents from the build folder into stable.
374389
# Targets will have the form exampleName_stabilize.
375390
$(filter %$(STABILIZE_E_SUFFIX), $(STABILIZE_EXAMPLES)): %$(STABILIZE_E_SUFFIX): %$(BC_E_SUFFIX) %$(GEN_E_SUFFIX)
376-
- rm -rf "$(STABLE_FOLDER)$*/"
391+
rm -rf "./$(STABLE_FOLDER)$*/"
392+
@mkdir -p "$(STABLE_FOLDER)"
377393
- cp -r "$(BUILD_FOLDER)$(EDIR)" "$(STABLE_FOLDER)$*/"
378394

379395
$(GOOLTEST)$(STABILIZE_E_SUFFIX): $(GOOLTEST)$(GEN_E_SUFFIX)
380-
- rm -rf "$(STABLE_FOLDER)$(GOOLTEST_DIR)/"
396+
rm -rf "./$(STABLE_FOLDER)$(GOOLTEST_DIR)/"
397+
@mkdir -p "$(STABLE_FOLDER)"
381398
- cp -r "$(BUILD_FOLDER)$(GOOLTEST_DIR)/" "$(STABLE_FOLDER)$(GOOLTEST_DIR)"
382399

383400
# The website stabilization. First builds the website, and then copies the
384401
# contents from the website folder into stable-website.
385402
# Target will have the form Website_stabilize.
386403
$(filter %$(STABILIZE_E_SUFFIX), $(STABILIZE_WEBSITE)): %$(STABILIZE_E_SUFFIX): %$(BC_E_SUFFIX) website
387-
- rm -rf "$(STABLE_WEBSITE_FOLDER)"
404+
rm -rf "./$(STABLE_WEBSITE_FOLDER)"
405+
@mkdir -p "$(STABLE_WEBSITE_FOLDER)"
388406
- cp -r "$(WEBSITE_FOLDER)" "$(STABLE_WEBSITE_FOLDER)"
389407

390408
# Generate individual example pdfs. Needs Graphviz to work.
@@ -407,12 +425,16 @@ $(filter %$(MDBOOK_SERVER_E_SUFFIX), $(MDBOOK_SERVER_EXAMPLES)): %$(MDBOOK_SERVE
407425
- "$(SHELL)" "$(SCRIPT_FOLDER)copy_example_assets.sh" "$(BUILD_FOLDER)$(EDIR)/SRS/mdBook"
408426
mdbook serve --open "$(BUILD_FOLDER)$(EDIR)/SRS/mdBook"
409427

428+
# Targets will have the form exampleName_juphtml.
429+
$(filter %$(JUPYTER_HTML_E_SUFFIX), $(JUPYTER_HTML_EXAMPLES)): %$(JUPYTER_HTML_E_SUFFIX): %$(GEN_E_SUFFIX)
430+
jupyter nbconvert --to html "$(BUILD_FOLDER)$(EDIR)/SRS/Jupyter/*.ipynb"
431+
410432
#----------------------------------------------------------------------------------#
411433
#--- Generate analysis of module, class, datatype, and class instance structure ---#
412434
#----------------------------------------------------------------------------------#
413435

414436
graphs: $(GRAPH_PACKAGES) packagedeps ##@Analysis Generate all module dependency graphs.
415-
- echo "Graphs generated in local '$(GRAPH_FOLDER)' folder."
437+
@echo "Graphs generated in local '$(GRAPH_FOLDER)' folder."
416438

417439
# Generate individual package module dependency graphs.
418440
$(filter %$(GRAPH_P_SUFFIX), $(GRAPH_PACKAGES)): %$(GRAPH_P_SUFFIX): graphmod check_dot
@@ -424,7 +446,7 @@ $(filter %$(GRAPH_P_SUFFIX), $(GRAPH_PACKAGES)): %$(GRAPH_P_SUFFIX): graphmod ch
424446
# We also add example to these variables so that we can still
425447
# make the graphs for that folder (although it's technically not a package itself).
426448
analysis: graphmod ##@Analysis Generate a table and some graphs to analyze Drasil's class, datatype, and instance structures.
427-
- rm -rf "$(ANALYSIS_FOLDER)"
449+
rm -rf "./$(ANALYSIS_FOLDER)"
428450
@mkdir -p "$(ANALYSIS_FOLDER)"
429451
cd $(SCRIPT_FOLDER) && stack ClassInstDepGen.hs
430452
cd $(SCRIPT_FOLDER) && stack TypeDepGen.hs
@@ -587,6 +609,7 @@ help: ##@Help Show this help.
587609
@echo " X$(DCP_E_SUFFIX) Get all generated code file paths in the example."
588610
@echo " X$(MDBOOK_BUILD_E_SUFFIX) Build the mdBook SRS of an individual example."
589611
@echo " X$(MDBOOK_SERVER_E_SUFFIX) Launch local server for the mdBook SRS of an individual example."
612+
@echo " X$(JUPYTER_HTML_E_SUFFIX) Extract an HTML copy out of a Juypter Notebook."
590613
@echo ""
591614
@echo "Set a 'DEBUG_ENV' environment variable to 'true' if you want to check out the list of chunks in a Drasil run."
592615
@echo ""
@@ -604,4 +627,4 @@ help_packages: ##@Help Lists all packages.
604627
echo " $$package"; \
605628
done
606629

607-
.PHONY: help setup_debug_vars clean clean_artifacts cleanArtifacts gool code deps hlint hot_hlint analysis tex doc debug test graphs graphmod check_stack nographs graphs website deploy_code_path deploy deploy_lite all install examples tracegraphs doxygen shellcheck mdbook_build $(GOOLTEST) $(ALL_EXPANDED_TARGETS)
630+
.PHONY: help setup_debug_vars clean clean_artifacts cleanArtifacts gool code deps hlint hot_hlint analysis tex doc debug test graphs graphmod check_stack nographs graphs website deploy_code_path deploy deploy_lite all install examples tracegraphs doxygen shellcheck mdbook_build jupyter_html $(GOOLTEST) $(ALL_EXPANDED_TARGETS)

code/drasil-build/stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# resolver: ./custom-snapshot.yaml
1919
# resolver: https://example.com/snapshots/2018-01-01.yaml
20-
resolver: lts-22.31
20+
resolver: lts-22.44
2121

2222
# User packages to be built.
2323
# Various formats can be used as shown in the example below.

code/drasil-code/lib/Data/Drasil/ExternalLibraries/ODELibraries.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module Data.Drasil.ExternalLibraries.ODELibraries (
77
-- * Apache Commons (Java)
88
apacheODEPckg, apacheODESymbols,
99
-- * Odeint (C++)
10-
odeintPckg, odeintSymbols, diffCodeChunk
10+
odeintPckg, odeintSymbols, diffCodeChunk,
11+
odeInfoChunks
1112
) where
1213
import Language.Drasil hiding (dim)
1314
import Language.Drasil.Space (ClifKind(..))
@@ -683,3 +684,14 @@ modifiedODESyst sufx info = map replaceDepVar (odeSyst info)
683684
(replaceDepVar e1) (replaceDepVar e2)
684685
replaceDepVar (CE.Operator ao dd e) = CE.Operator ao dd $ replaceDepVar e
685686
replaceDepVar e = e
687+
688+
-- | Collect all chunks related to a specific ODE
689+
odeInfoChunks :: ODEInfo -> [DefinedQuantityDict]
690+
odeInfoChunks info =
691+
let dv = depVar info
692+
in map dqdWr [ dv
693+
, listToArray dv
694+
, arrayVecDepVar info
695+
, diffCodeChunk dv
696+
, listToArray $ diffCodeChunk dv
697+
]

code/drasil-code/lib/Language/Drasil/Chunk/CodeBase.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Language.Drasil.Chunk.CodeBase where
22

3-
import Database.Drasil (ChunkDB, symbResolve)
3+
import Database.Drasil (ChunkDB, findOrErr)
44
import Drasil.Code.CodeExpr.Development
55
import Language.Drasil
66

@@ -22,8 +22,8 @@ codevars' e m = map (varResolve m) $ eDep' e
2222

2323
-- | Make a 'CodeVarChunk' from a 'UID' in the 'ChunkDB'.
2424
varResolve :: ChunkDB -> UID -> CodeVarChunk
25-
varResolve m x = quantvar $ symbResolve m x
25+
varResolve m x = quantvar (findOrErr x m :: DefinedQuantityDict)
2626

2727
-- | Make a 'CodeFuncChunk' from a 'UID' in the 'ChunkDB'.
2828
funcResolve :: ChunkDB -> UID -> CodeFuncChunk
29-
funcResolve m x = quantfunc $ symbResolve m x
29+
funcResolve m x = quantfunc (findOrErr x m :: DefinedQuantityDict)

code/drasil-code/lib/Language/Drasil/Code/Imperative/Comments.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module Language.Drasil.Code.Imperative.Comments (
33
getComment, getCommentBrief
44
) where
55

6+
import Drasil.Database.SearchTools (DomDefn (definition), defResolve')
67
import Language.Drasil
7-
import Database.Drasil (DomDefn (definition), defResolve')
88
import Language.Drasil.Code.Imperative.DrasilState (GenState, DrasilState(..))
99
import Language.Drasil.CodeSpec (HasOldCodeSpec(..))
1010
import Language.Drasil.Printers (SingleLine(OneLine), sentenceDoc, unitDoc)
@@ -49,4 +49,4 @@ getCommentBrief :: (CodeIdea c) => c -> GenState String
4949
getCommentBrief l = do
5050
t <- getTermDoc l
5151
let u = getUnitsDoc l
52-
return $ render $ t <+> u
52+
return $ render $ t <+> u

code/drasil-code/lib/Language/Drasil/Code/Imperative/Helpers.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module Language.Drasil.Code.Imperative.Helpers (
22
liftS, lookupC, convScope
33
) where
44

5+
import Database.Drasil (findOrErr)
56
import Language.Drasil (UID, DefinedQuantityDict)
6-
import Database.Drasil (symbResolve)
77
import Language.Drasil.Code.Imperative.DrasilState (DrasilState(..),
88
ScopeType(..))
99
import Language.Drasil.CodeSpec (HasOldCodeSpec(..))
@@ -18,10 +18,10 @@ liftS = fmap (: [])
1818

1919
-- | Gets the 'DefinedQuantityDict' corresponding to a 'UID'.
2020
lookupC :: DrasilState -> UID -> DefinedQuantityDict
21-
lookupC g = symbResolve (codeSpec g ^. systemdbO)
21+
lookupC g u = findOrErr u (codeSpec g ^. systemdbO)
2222

2323
-- | Converts a 'ScopeType' to a 'Scope'
2424
convScope :: (SharedProg r) => ScopeType -> r (Scope r)
2525
convScope Local = local
2626
convScope Global = global
27-
convScope MainFn = mainFn
27+
convScope MainFn = mainFn

0 commit comments

Comments
 (0)