addToken(i - lastOffset,COMMAND);
addToken(i - lastOffset,Token.KEYWORD1);
	public Token markTokens(Segment line, int lineIndex)	{		ensureCapacity(lineIndex);		lastToken = null;		String token = lineIndex == 0 ? null : lineInfo[lineIndex - 1];		byte cmdState = 0; // 0 = space before command, 1 = inside				// command, 2 = after command		int offset = line.offset;		int lastOffset = offset;		int length = line.count + offset;		boolean backslash = false;loop:		for(int i = offset; i < length; i++)		{			char c = line.array[i];			if(token == VARIABLE)			{				backslash = false;				if(!Character.isLetterOrDigit(c) && c != '_')				{					token = null;					if(i != offset && line.array[i-1] == '$')					{						addToken((i+1) - lastOffset,							VARIABLE);						lastOffset = i + 1;						continue;					}					else					{						addToken(i - lastOffset,							VARIABLE);						lastOffset = i;					}				}			}			else if(token == LVARIABLE && c == '}')			{				backslash = false;				token = null;				addToken((i+1) - lastOffset,VARIABLE);				lastOffset = i + 1;			}			switch(c)			{			case '\\':				backslash = !backslash;				break;			case ' ': case '\t': case '(': case ')':				backslash = false;				if(token == null && cmdState == 1/*insideCmd*/)				{					addToken(i - lastOffset,COMMAND);					lastOffset = i;					cmdState = 2; /*afterCmd*/				}				break;			case '=':				backslash = false;				if(token == null && cmdState == 1/*insideCmd*/)				{					addToken(i - lastOffset,null);					lastOffset = i;					cmdState = 2; /*afterCmd*/				}				break;			case '&': case '|': case ';':				if(backslash)					backslash = false;				else					cmdState = 0; /*beforeCmd*/				break;			case '#':				if(backslash)					backslash = false;				else if(token == null)				{					addToken(i - lastOffset,null);					addToken(length - i,COMMENT);					lastOffset = length;					break loop;				}				break;			case '$':				if(backslash)					backslash = false;				else if(token == null)				{					if(length - i >= 2)					{						switch(line.array[i+1])						{						case '(':							continue;						case '{':							token = LVARIABLE;							break;						default:							token = VARIABLE;							break;						}					}					else						token = VARIABLE;					addToken(i - lastOffset,null);					cmdState = 2; /*afterCmd*/					lastOffset = i;				}				break;			case '"':				if(backslash)					backslash = false;				else if(token == null)				{					token = DQUOTE;					addToken(i - lastOffset,null);					cmdState = 2; /*afterCmd*/					lastOffset = i;				}				else if(token == DQUOTE)				{					token = null;					addToken((i+1) - lastOffset,DQUOTE);					cmdState = 2; /*afterCmd*/					lastOffset = i + 1;				}				break;			case '\'':				if(backslash)					backslash = false;				else if(token == null)				{					token = SQUOTE;					addToken(i - lastOffset,null);					cmdState = 2; /*afterCmd*/					lastOffset = i;				}				else if(token == SQUOTE)				{					token = null;					addToken((i+1) - lastOffset,SQUOTE);					cmdState = 2; /*afterCmd*/					lastOffset = i + 1;				}				break;			default:				backslash = false;				if(Character.isLetter(c))				{					if(cmdState == 0 /*beforeCmd*/)					{						addToken(i - lastOffset,token);						lastOffset = i;						cmdState++; /*insideCmd*/					}				}				break;			}		}		if(lastOffset != length)			addToken(length - lastOffset,token == null &&				cmdState == 1 ? COMMAND : token);		lineInfo[lineIndex] = (token == SQUOTE || token == DQUOTE			? token : null);		if(lastToken != null)		{			lastToken.nextValid = false;			return firstToken;		}		else			return null;	}