Skip to content

Commit

Permalink
Allow evaluation of field_expression if it's not under a call_expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Nov 16, 2024
1 parent 1c49572 commit 3aa8ffc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions dev/julia/sandbox.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Pkg
Pkg.activate("project")
Pkg.activate

1 + 1

Expand Down
11 changes: 9 additions & 2 deletions fnl/conjure/client/julia/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@
(local comment-prefix "# ")

(fn form-node? [node]
(and (not= "field_expression" (node:type))
(not= "argument_list" (node:type))))
(let [parent (node:parent)]
(and
;; Pkg.activate(...) should execute the expression Pkg.foo should just return foo.
(not (and
(= "call_expression" (parent:type))
(= "field_expression" (node:type))))

;; Don't eval arg lists as tuples, just evaluate the call_expression above.
(not= "argument_list" (node:type)))))

(fn with-repl-or-warn [f _opts]
(let [repl (state :repl)]
Expand Down
3 changes: 2 additions & 1 deletion lua/conjure/client/julia/stdio.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3aa8ffc

Please sign in to comment.