public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) { ITextRegion newRegion = new ContextRegion(context, start, textLength, length); return newRegion; } }
public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) { ITextRegion newRegion = null; if (context == DOMJSPRegionContexts.JSP_CONTENT) { newRegion = new ForeignRegion(context, start, textLength, length); } else newRegion = super.createToken(context, start, textLength, length, lang, surroundingTag); return newRegion; } }
protected String getPartitionType(ForeignRegion region, int offset) { String tagname = region.getSurroundingTag(); String result = null; // tagname should not be null, // but see https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4911 if (tagname == null) { result = getUnknown(); } else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) result = IHTMLPartitions.SCRIPT; else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) result = ICSSPartitions.STYLE; else result = super.getPartitionType(region, offset); return result; }
newRegion = new ForeignRegion(context, start, textLength, length); ((ForeignRegion) newRegion).setSurroundingTag(surroundingTag); newRegion = new ContextRegion(context, start, textLength, length);
isFullReparsed = false; return super.updateRegion(requester, flatnode, changes, requestStart, lengthToReplace);
public ITextRegion createRegion(String context, int start, int textLength, int length) { ITextRegion region = null; region = new ContextRegion(context, start, textLength, length); return region; }
public synchronized void addLast(String yylex, int start, int yylengthLength, int yylength, Object lexerState) { assert (twigTokens.size() == 0 || getLastToken().getEnd() == start) && tokensIterator == null; // if state was change - we add a new token and add state if (lexerStateChanges.size() == 0 || !getLastChange().state.equals(lexerState)) { int textLength = (AbstractTwigLexer.WHITESPACE.equals(yylex)) ? 0 : yylengthLength; final ContextRegion contextRegion = new ContextRegion(yylex, start, textLength, yylength); twigTokens.addLast(contextRegion); lexerStateChanges.addLast(new LexerStateChange((LexerState) lexerState, contextRegion)); return; } assert twigTokens.size() > 0; // if we can only adjust the previous token size if (yylex == AbstractTwigLexer.WHITESPACE) { final ITextRegion last = twigTokens.getLast(); last.adjustLength(yylength); } else { // else - add as a new token final ContextRegion contextRegion = new ContextRegion(yylex, start, yylengthLength, yylength); twigTokens.addLast(contextRegion); } }
bufferedTokens.add(new ContextRegion(yylex, 0, yylength(), yylength())); yylex = removeFromBuffer(); } else if (PHPPartitionTypes.isPHPCommentState(yylex)) {