Comments (3)
Thanks @olafura! Yes the return should be a flat list of binding names, it is very difficult to take this apart in Java, like an untyped XML DOM. The function clause combinations do get very complex. In the example case we can get the binding names from the dialyzer spec initially, and then use the function clause to fill in the blanks.
So for example, in this function.
myfunc(0, Acc) -> Acc
myfunc(Index, _) -> myfunc(Index-1, 2).
The list of returned arguments should be ["Index", "Acc"]
. If there were two different names for the same argument e.g.
myfunc(0, Acc) -> Acc
myfunc(Index, X) -> myfunc(Index-1, X+1).
Then we could return ["Index", "Acc|X"]
. Names in the dialyzer spec should probably override this, unless we don't trust that the spec is being kept upto date!? Maybe we should return that too if it is different to the names in the clause.
from erlyberly.
So I have an initial results, I have yet to convert the params from their ast form. But in their lies the crux, we have complex params like process_info2 on line 79, size_to_bytes on line 118 and record fields on line 155.
Here is a diff:
diff --git a/src/main/resources/erlyberly/beam/erlyberly.erl b/src/main/resources/erlyberly/beam/erlyberly.erl
index 633d35c..bb9a4b0 100644
--- a/src/main/resources/erlyberly/beam/erlyberly.erl
+++ b/src/main/resources/erlyberly/beam/erlyberly.erl
@@ -26,6 +26,7 @@
-export([get_source_code/1]).
-export([load_modules_on_path/1]).
-export([load_module_records/1]).
+-export([load_module_functions/1]).
-export([module_functions/0]).
-export([process_info/0]).
-export([saleyn_fun_src/1]).
@@ -174,6 +175,13 @@ load_module_records(Mod) ->
Records = [{Tag, record_fields(Fields)} || {attribute,_,record,{Tag,Fields}} <- Forms],
{ok, Records}.
+load_module_functions(Mod) ->
+ {ok, Forms} = load_module_forms(Mod),
+ Functions = [
+ {Function,Params} || {function,_,Function,_,FunctionBody} <- Forms,
+ {clause,_,Params, _Guard, _Body} <- FunctionBody],
+ {ok, Functions}.
+
%%% ============================================================================
%%% module function tree
%%% ============================================================================
from erlyberly.
I can of course just extract the vars, if you want ;)
from erlyberly.
Related Issues (20)
- Modules tree prefixes Elixir modules with Elixir. HOT 1
- In Elixir registered names of a process should not have the 'Elixir.' prefix HOT 3
- Problem with fonts loading, icons are not displayed
- Trace filters not working on function arguments HOT 1
- Single Line get started problem
- Cannot connect to Elixir instance (Elixir 1.5.2 & Erlang 20.1.5) HOT 6
- Java 9 Not Supported HOT 3
- Exception and failure to display maps
- Process List stays empty for the remote node HOT 1
- Can't connect to remote nodes via SSH tunnel HOT 2
- Getting error "java.lang.RuntimeException: error loading the erlyberly module" while connecting to target node HOT 6
- rejected since it cannot handle ["BIG_CREATION"] HOT 5
- How to connect to node in container?
- I can't compile on mac m1. HOT 6
- Unable to connect a node to ErlyBerly HOT 1
- Double click on a trace throws an exception
- Query: What is the use of "Add breaker" operation? HOT 2
- Unable to trace common_test module
- connect error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erlyberly.