-
Notifications
You must be signed in to change notification settings - Fork 0
fix module scoping #5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,7 @@ defmodule Lunary do | |
|
|
||
| defp evaluate({:func_access, index, {:fn, {:identifier, fn_line, fn_id}, fn_args}}, scope, opts) do | ||
| {func_scope, _} = evaluate(index, scope, opts) | ||
| merged_scope = Map.merge(func_scope, scope) | ||
| merged_scope = Map.merge(scope, func_scope) # function scope takes priority | ||
| evaluate({:fn, {:identifier, fn_line, fn_id}, fn_args}, merged_scope, opts) | ||
|
Comment on lines
131
to
134
|
||
| end | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: the inline comment says "function scope takes priority", but
func_scopehere is actually the evaluated module scope coming fromindex(e.g.,@example). Consider rewording to avoid confusion when revisiting scoping rules later.