Skip to content

Commit 3aa8ffc

Browse files
committed
Allow evaluation of field_expression if it's not under a call_expression
1 parent 1c49572 commit 3aa8ffc

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

dev/julia/sandbox.jl

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Pkg
22
Pkg.activate("project")
3+
Pkg.activate
34

45
1 + 1
56

fnl/conjure/client/julia/stdio.fnl

+9-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@
3131
(local comment-prefix "# ")
3232

3333
(fn form-node? [node]
34-
(and (not= "field_expression" (node:type))
35-
(not= "argument_list" (node:type))))
34+
(let [parent (node:parent)]
35+
(and
36+
;; Pkg.activate(...) should execute the expression Pkg.foo should just return foo.
37+
(not (and
38+
(= "call_expression" (parent:type))
39+
(= "field_expression" (node:type))))
40+
41+
;; Don't eval arg lists as tuples, just evaluate the call_expression above.
42+
(not= "argument_list" (node:type)))))
3643

3744
(fn with-repl-or-warn [f _opts]
3845
(let [repl (state :repl)]

lua/conjure/client/julia/stdio.lua

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)