mbien commented on code in PR #9540:
URL: https://github.com/apache/netbeans/pull/9540#discussion_r3824208759
##########
ide/xml.xdm/src/org/netbeans/modules/xml/xdm/nodes/XMLSyntaxParser.java:
##########
@@ -44,22 +46,8 @@ public Document parse(BaseDocument basedoc)
List<Token> currentTokens = new ArrayList<Token>();
TokenHierarchy th = TokenHierarchy.get(basedoc);
TokenSequence<XMLTokenId> tokenSequence = th.tokenSequence();
- org.netbeans.api.lexer.Token<XMLTokenId> token =
tokenSequence.token();
- // Add the text token, if any, before xml decalration to document
node
- if(token != null && token.id() == XMLTokenId.TEXT) {
-
currentTokens.add(Token.create(token.text().toString(),TokenType.TOKEN_CHARACTER_DATA));
- if(tokenSequence.moveNext()) {
- token = tokenSequence.token();
- }
- // if the xml decalration is not there assign this token to
document
- if(token.id() != XMLTokenId.PI_START) {
- currentNode.setTokens(new ArrayList<Token>(currentTokens));
- currentTokens.clear();
- }
- }
Review Comment:
makes sense, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists