Skip to content

Commit 505a308

Browse files
authored
handle module version (#33)
* handle module version * bmp ver * aah * microslop
1 parent acce29f commit 505a308

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExpressionExplorer"
22
uuid = "21656369-7473-754a-2065-74616d696c43"
33
license = "MIT"
4-
version = "1.1.3"
4+
version = "1.1.4"
55
authors = ["Paul Berg <[email protected]>", "Fons van der Plas <[email protected]>"]
66

77
[deps]

src/explore.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,8 @@ end
769769
function explore_module!(ex::Expr, scopestate::ScopeState)
770770
# Does create it's own scope, but can import from outer scope, that's what `explore_module_definition!` is for
771771
symstate = explore_module_definition!(ex, scopestate)
772-
return union(symstate, SymbolsState(assignments = Set{Symbol}([ex.args[2]])))::SymbolsState
772+
module_name_num = ex.args[1] isa VersionNumber ? 3 : 2
773+
return union(symstate, SymbolsState(assignments = Set{Symbol}([ex.args[module_name_num]])))::SymbolsState
773774
end
774775

775776
function explore_fallback!(ex::Expr, scopestate::ScopeState)
@@ -873,7 +874,8 @@ function explore_module_definition!(ex::Expr, scopestate; module_depth::Number =
873874
return symstate
874875
elseif ex.head === :module
875876
# Explorer the block inside with one more depth added
876-
return explore_module_definition!(ex.args[3], scopestate, module_depth = module_depth + 1)
877+
block_num = ex.args[1] isa VersionNumber ? 4 : 3
878+
return explore_module_definition!(ex.args[block_num], scopestate, module_depth = module_depth + 1)
877879
elseif ex.head === :quote
878880
# TODO? Explore interpolations, modules can't be in interpolations, but `import`'s can >_>
879881
return SymbolsState()

0 commit comments

Comments
 (0)