DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35724>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35724





------- Additional Comments From [EMAIL PROTECTED]  2005-07-14 02:26 -------
E.g. some of the code snippets from the dev/user guide:

--schnipp--
#sset($bla= "fahsel" )
## This is a single line comment.
#*
 Thus begins a multi-line comment. Online visitors won't
 see this text because the Velocity Templating Engine will
 ignore it.
*#
#set($myarr = ["a","b","c"] )
$foo.bar( $myarr ) $myarr[0]
--schnapp--


The AST tree available for an ParserViewer (e.g. like NodeViewMode) is:

--schnipp--
ASTprocess [pos=1:1:86,type=0,valid=false,info=0] -> #sset
  ASTDirective [pos=1:1:5,type=10,valid=false,info=0] -> #sset
  ASTText [pos=1:6:1,type=19,valid=false,info=0] -> (
  ASTReference [pos=1:7:4,type=16,valid=false,info=0] -> $bla
  ASTText [pos=1:11:13,type=19,valid=false,info=0] -> == "fahsel" )

  ASTComment [pos=2:34:1,type=4,valid=false,info=0] -> 

  ASTComment [pos=7:1:2,type=4,valid=false,info=0] -> *#
  ASTText [pos=7:3:1,type=19,valid=false,info=0] -> 

  ASTSetDirective [pos=8:1:30,type=23,valid=false,info=0] -> #set(
    ASTReference [pos=8:6:6,type=16,valid=false,info=0] -> $myarr
    ASTExpression [pos=8:14:15,type=25,valid=false,info=0] ->  
      ASTObjectArray [pos=8:15:13,type=13,valid=false,info=0] -> [
        ASTStringLiteral [pos=8:16:3,type=7,valid=false,info=0] -> "a"
        ASTStringLiteral [pos=8:20:3,type=7,valid=false,info=0] -> "b"
        ASTStringLiteral [pos=8:24:3,type=7,valid=false,info=0] -> "c"
  ASTReference [pos=9:1:18,type=16,valid=false,info=0] -> $foo
    ASTMethod [pos=9:6:13,type=15,valid=false,info=0] -> bar
      ASTIdentifier [pos=9:6:3,type=8,valid=false,info=0] -> bar
      ASTReference [pos=9:11:6,type=16,valid=false,info=0] -> $myarr
  ASTText [pos=9:19:1,type=19,valid=false,info=0] ->   
  ASTReference [pos=9:20:6,type=16,valid=false,info=0] -> $myarr
  ASTText [pos=9:26:3,type=19,valid=false,info=0] -> [[0]
--schnapp--

pos=X:Y:Z has to be interpreted as X=line, Y=column, Z=literal().length()

As you can see, the multi-line comment is in the AST, but its position has been
recorded as the one of the end token for the commen (i.e. *#). So everything
between the comment start token incl. the token itself is not available.

For the single line column, the start token incl. the comment content is also
not available. Just the linefeed char at the end of the comment...

So if I use a parserViewer for traversing a node and find a comment I have a
problem, since I don't really know, where the comment starts (plz have a look at
the NodeViewMode#showNode). 
 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to