Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Visualize to_son (sea of nodes) using mermaid.js already added #9

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

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix identation problems
  • Loading branch information
wenderjean committed Mar 30, 2023
commit 41e92af29383b60223f47ed22f16b057b1a5e7d7
14 changes: 7 additions & 7 deletions src/createRuby.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ export default async function createRuby() {

return vm.eval(rubySource).toString();
},
// A function to print the current YARV execution
seaOfNodes(source) {
// A function to print the current YARV execution
seaOfNodes(source) {
const jsonSource = JSON.stringify(JSON.stringify(source));
const rubySource = `
iseq = RubyVM::InstructionSequence.compile(JSON.parse(${jsonSource}))
iseq = SyntaxTree::YARV::InstructionSequence.from(iseq.to_a)
iseq.to_son.to_mermaid
`;
iseq = RubyVM::InstructionSequence.compile(JSON.parse(${jsonSource}))
iseq = SyntaxTree::YARV::InstructionSequence.from(iseq.to_a)
iseq.to_son.to_mermaid
`;

return vm.eval(rubySource).toString();
}
}
};
};