Пример #1
0
        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
            }));
        }
Пример #2
0
 public void Grouping(string expected, string input) => Assert.Equal(expected.Trim(), JavascriptTransformer.Transform(input).Trim());
Пример #3
0
 public void Declarations(string expected, string input) => Assert.Equal(expected.Trim(), JavascriptTransformer.Transform(input).Trim());
Пример #4
0
        public void Addition(string expected, string input)
        {
            var result = JavascriptTransformer.Transform(input).Trim();

            Assert.Equal(expected.Trim(), result.Trim());
        }