Details

    • Type: Wish
    • Status: Closed
    • Priority: Trivial
    • Resolution: Done
    • Affects Version/s: 1.7
    • Fix Version/s: 2.0
    • Component/s: Engine
    • Labels:

      Description

      when I use velocity to find the ast info, I find it difficulty to read the output info。
      e.g.
      vm:
      #if(true)#end

      node dump print:
      SimpleNode [id=0, info=0, invalid=false, children=[SimpleNode [id=23, info=0, invalid=false, children=[SimpleNode [id=27, info=0, invalid=false, children=[SimpleNode [id=20, info=0, invalid=false, children=null, tokens=[true]]], tokens=[true]], SimpleNode [id=13, info=0, invalid=false, children=null, tokens=[#end
      ], [
      ]]], tokens=if, [(], [true], [)], [#end
      ]]], tokens=if, [(], [true], [)], [#end
      ], [
      ]] -> #if
      SimpleNode [id=23, info=0, invalid=false, children=[SimpleNode [id=27, info=0, invalid=false, children=[SimpleNode [id=20, info=0, invalid=false, children=null, tokens=[true]]], tokens=[true]], SimpleNode [id=13, info=0, invalid=false, children=null, tokens=[#end
      ], [
      ]]], tokens=if, [(], [true], [)], [#end
      ]] -> #if
      SimpleNode [id=27, info=0, invalid=false, children=[SimpleNode [id=20, info=0, invalid=false, children=null, tokens=[true]]], tokens=[true]] -> true
      SimpleNode [id=20, info=0, invalid=false, children=null, tokens=[true]] -> true
      SimpleNode [id=13, info=0, invalid=false, children=null, tokens=[#end
      ], [
      ]] -> #end

      every node is simpleNode, I can find more clear node info.

      after analyze code,wo can change as following:
      SimpleNode (435 line):
      change :
      return "SimpleNode [id=" + id + ", info=" + info + ", invalid="
      to:
      return getClass().getSimpleName() + " [id=" + id + ", info=" + info + ", invalid="

      final node dump:
      ASTprocess [id=0, info=0, invalid=false, children=[ASTIfStatement [id=23, info=0, invalid=false, children=[ASTExpression [id=27, info=0, invalid=false, children=[ASTTrue [id=20, info=0, invalid=false, children=null, tokens=[true]]], tokens=[true]], ASTBlock [id=13, info=0, invalid=false, children=null, tokens=[#end
      ], [
      ]]], tokens=if, [(], [true], [)], [#end
      ]]], tokens=if, [(], [true], [)], [#end
      ], [
      ]] -> #if
      ASTIfStatement [id=23, info=0, invalid=false, children=[ASTExpression [id=27, info=0, invalid=false, children=[ASTTrue [id=20, info=0, invalid=false, children=null, tokens=[true]]], tokens=[true]], ASTBlock [id=13, info=0, invalid=false, children=null, tokens=[#end
      ], [
      ]]], tokens=if, [(], [true], [)], [#end
      ]] -> #if
      ASTExpression [id=27, info=0, invalid=false, children=[ASTTrue [id=20, info=0, invalid=false, children=null, tokens=[true]]], tokens=[true]] -> true
      ASTTrue [id=20, info=0, invalid=false, children=null, tokens=[true]] -> true
      ASTBlock [id=13, info=0, invalid=false, children=null, tokens=[#end
      ], [
      ]] -> #end

        Attachments

          Activity

            People

            • Assignee:
              claude Claude Brisson
              Reporter:
              madding.lip madding.lip
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1m
                1m
                Remaining:
                Remaining Estimate - 1m
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified