public IActionResult Translate([FromBody] string input) { var result = JavascriptTransformer.Transform(input); var node = ASTTransformer.Transform(input); var variables = new HashSet <string>(); FindingVariableNode(node, variables); return(Ok(new ParserResult() { RootNode = node, CompiledString = result, Variables = variables })); }
public void Grouping(string expected, string input) => Assert.Equal(expected.Trim(), JavascriptTransformer.Transform(input).Trim());
public void Declarations(string expected, string input) => Assert.Equal(expected.Trim(), JavascriptTransformer.Transform(input).Trim());
public void Addition(string expected, string input) { var result = JavascriptTransformer.Transform(input).Trim(); Assert.Equal(expected.Trim(), result.Trim()); }