-
Notifications
You must be signed in to change notification settings - Fork 35
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
Support julia #175
Comments
In order to add a new language, I need sample code with oneline/multiline nodes for that language (example: https://github.com/Wansmer/treesj/tree/main/tests/sample). |
I hope this is something along the lines of what you wanted. I am not 100% sure if I got it right, for instance I just put preset default everywhere, but I don't really know what that does :). I also wasn't sure if the nested array needed special handling or not # RESULT OF JOIN (node "argument_list", preset default)
filled_dict = Dict("one" => 1, "two" => 2, "three" => 3)
# RESULT OF SPLIT (node "argument_list", preset default)
filled_dict = Dict(
"one" => 1,
"two" => 2,
"three" => 3,
)
# RESULT OF JOIN (node "vector_expression", preset default)
other_arr = [4, 5, 6]
# RESULT OF SPLIT (node "vector_expression", preset default)
other_arr = [
4,
5,
6,
]
# RESULT OF JOIN (node "matrix_expression", preset default)
other_arr = [1 2 3; 4 5 6]
# RESULT OF SPLIT (node "matrix_expression", preset default)
other_arr = [
1 2 3
4 5 6
]
# RESULT OF JOIN (node "vector_expression", preset default)
other_arr = [[1 2 3], [4 5 6]]
# RESULT OF SPLIT (node "vector_expression", preset default)
other_arr = [
[1 2 3],
[4 5 6],
]
# RESULT OF JOIN (node "vector_expression", preset default)
multi_arr = [[1, 2], [3, 4], [5, 6]]
# RESULT OF SPLIT (node "vector_expression", preset default)
multi_arr = [
[1, 2],
[3, 4],
[5, 6],
]
# RESULT OF JOIN (node "tuple_expression", preset default)
tup = (1, 2, 3)
# RESULT OF SPLIT (node "tuple_expression", preset default)
tup = (
1,
2,
3,
)
# RESULT OF JOIN (node "argument_list" and "function_definition", preset default)
function create_adder(x, b)
adder(y) = x + y
return adder
end
# RESULT OF SPLIT (node "argument_list" and "function_definition", preset default)
function create_adder(
x,
b,
)
adder(y) = x + y
return adder
end
# RESULT OF JOIN (node "comprehension_expression", preset default)
comp_arr = [i^2 for i in 1:5]
# RESULT OF SPLIT (node "comprehension_expression", preset default)
comp_arr = [
i^2
for i in 1:5
]
# RESULT OF JOIN (node "call_expression", preset default)
result = sum([1, 2, 3])
# RESULT OF SPLIT (node "call_expression", preset default)
result = sum(
[1, 2, 3]
)
# RESULT OF JOIN (node "using_statement", preset default)
using Statistics, Lasso, ProjectRoot
# RESULT OF SPLIT (node "using_statement", preset default)
using Statistics,
Lasso,
ProjectRoot
# RESULT OF JOIN (node "selected_import" and "using_statement", preset default)
using Statistics: mean, median, std
# RESULT OF SPLIT (node "selected_import" and "using_statement", preset default)
using Statistics:
mean,
median,
std
# RESULT OF JOIN (node "open_tuple" and "assignment", preset default)
t1, t2, t3 = (1, 2, 3)
# RESULT OF SPLIT (node "tuple_expression" and "assignment", preset default)
(
t1,
t2,
t3,
) = (1, 2, 3) |
Done #178 |
Great! Thanks a lot for the work on this! |
It would be nice to support julia. We could probably borrow a lot from for instance the R and python parsers.
The text was updated successfully, but these errors were encountered: