Closed willow-ahrens closed 3 years ago
Do you mind to add a few tests?
Nice! and a doc string would be great too.
Alright, docstring and tests added!
Alright! Thanks @MasonProtter for the suggestions! I've resolved everything except for the potential macrotools name collision. It might be easiest to simply leave the macro un-exported, but I'll wait for your (or another) opinion on the matter.
The version has been bumped to 16.0 because this is a breaking change.
Merging #343 (162d419) into master (609f7a2) will decrease coverage by
0.18%
. The diff coverage is69.23%
.
@@ Coverage Diff @@
## master #343 +/- ##
==========================================
- Coverage 83.80% 83.61% -0.19%
==========================================
Files 12 12
Lines 1451 1465 +14
==========================================
+ Hits 1216 1225 +9
- Misses 235 240 +5
Impacted Files | Coverage Δ | |
---|---|---|
src/rule.jl | 84.44% <69.23%> (-2.34%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 609f7a2...162d419. Read the comment docs.
I don't see any breaking changes though? What's something that doesn't work that used to work?
using MacroTools; using SymbolicUtils
used to work, now results in name collision because we export @capture
. If you don't want me to bump the version I can set it back.
Ah ok!
We really shouldn't export @capture
[ Info: Precompiling ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78]
WARNING: both MacroTools and SymbolicUtils export "@capture"; uses of it in module Symbolics must be qualified
WARNING: both Symbolics and MacroTools export "@capture"; uses of it in module ModelingToolkit must be qualified
Perhaps that should go in a separate PR? Unless you'd like me to push a quick fix to this branch, which I'm willing to do.
Yeah, let's make a new PR and a new breaking release.
This commit adds a simple macro for simply matching terms and injecting the matches into the current scope, as described in #342. The macro returns true or false depending on whether the pattern was matched.