# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: cnd/completion/src/org/netbeans/modules/cnd/completion/cplusplus/ext/CsmCompletionTokenProcessor.java --- cnd/completion/src/org/netbeans/modules/cnd/completion/cplusplus/ext/CsmCompletionTokenProcessor.java Base (1.15) +++ cnd/completion/src/org/netbeans/modules/cnd/completion/cplusplus/ext/CsmCompletionTokenProcessor.java Locally Modified (Based On 1.15) @@ -601,7 +601,8 @@ CsmCompletionExpression constExp = null; // possibly assign constant into this exp String kwdType = CCTokenContext.isType(tokenID) ? curTokenText : null; // keyword constant type (used in conversions) - if (tokenID == null) { // invalid token-id + // clear stack on absent token or prerpocessor token + if (tokenID == null || tokenID.getCategory() == CCTokenContext.CPP) { errorState = true; } else { // valid token-id @@ -1835,6 +1836,18 @@ } public int eot(int offset) { + if (lastValidTokenID != null) { + // if space or comment occurs as last token + // add empty variable to save last position + switch (lastValidTokenID.getNumericID()) { + case CCTokenContext.WHITESPACE_ID: + case CCTokenContext.LINE_COMMENT_ID: + case CCTokenContext.BLOCK_COMMENT_ID: + pushExp(CsmCompletionExpression.createEmptyVariable( + bufferStartPos + bufferOffsetDelta + offset)); + break; + } + } // Check for joins boolean reScan = true; while (reScan) {