Scan one or more spaces or tab characters, combining them to form an
"indent".

@return
423553
public Token scanIndent() {
		int start = pos;
		while (pos < input.length()
				&& (input.charAt(pos) == ' ' || input.charAt(pos) == '\t')) {
			pos++;
		}
		return new Token(Token.Kind.Indent, input.substring(start, pos), start);
	}
1266948
public String getFormatted() {
        String input = this.getUnformatted() + "   ";
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < this.getUnformatted().length(); i+= 4) {
            buf.append(input, i, i+4);
            buf.append(' ');
        }
        return buf.toString().trim();
    }
1343947
public static String getFormattedTagAndLength(final byte[] data, final int indentLength) {
		StringBuilder buf = new StringBuilder();
		String indent = getSpaces(indentLength);
		TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(data));

		boolean firstLine = true;
		try {
			while (stream.available() > 0) {
				if (firstLine) {
					firstLine = false;
				} else {
					buf.append("\n");
				}
				buf.append(indent);

				ITag tag = searchTagById(stream.readTag());
				int length = stream.readLength();

				buf.append(prettyPrintHex(tag.getTagBytes()));
				buf.append(" ");
				buf.append(String.format("%02x", length));
				buf.append(" -- ");
				buf.append(tag.getName());
			}
		} catch (IOException e) {
			LOGGER.error(e.getMessage(), e);
		} finally {
			IOUtils.closeQuietly(stream);
		}
		return buf.toString();
	}
292089
public Token scanCharacterLiteral() {
		int start = pos;
		pos++;
		char c = input.charAt(pos++);
		if (c == '\\') {
			// escape code
			switch (input.charAt(pos++)) {
			case 'b':
				c = '\b';
				break;
			case 't':
				c = '\t';
				break;
			case 'n':
				c = '\n';
				break;
			case 'f':
				c = '\f';
				break;
			case 'r':
				c = '\r';
				break;
			case '"':
				c = '\"';
				break;
			case '\'':
				c = '\'';
				break;
			case '\\':
				c = '\\';
				break;
			default:
				syntaxError("unrecognised escape character", pos);
			}
		}
		if (input.charAt(pos) != '\'') {
			syntaxError("unexpected end-of-character", pos);
		}
		pos = pos + 1;
		return new Token(Token.Kind.CharLiteral, input.substring(start, pos),
				start);
	}
960850
private static void appendIndentedNewLine(int indentLevel, StringBuilder stringBuilder) {
        stringBuilder.append("\n");
        for (int i = 0; i < indentLevel; i++) {
            // Assuming indention using 2 spaces
            stringBuilder.append("  ");
        }
    }
147966
public List<Token> scan() {
		ArrayList<Token> tokens = new ArrayList<>();
		pos = 0;

		while (pos < input.length()) {
			char c = input.charAt(pos);

			if (isDigit(c)) {
				tokens.add(scanNumericLiteral());
			} else if (c == '"') {
				tokens.add(scanStringLiteral());
			} else if (c == '\'') {
				tokens.add(scanCharacterLiteral());
			} else if (isOperatorStart(c)) {
				tokens.add(scanOperator());
			} else if (isLetter(c) || c == '_') {
				tokens.add(scanIdentifier());
			} else if (Character.isWhitespace(c)) {
				scanWhiteSpace(tokens);
			} else {
				syntaxError("unknown token encountered",pos);
			}
		}

		return tokens;
	}
532170
public String scanLastNWSDouble() {
        int off = -1;
        while ( Character.isWhitespace(ch(off)) && off + index >= 0 )
        {
            off--;
        }
        return ""+ch(off)+ch(off-1);
    }
1241498
private String canonicalString() {
    ImmutableList<String> segments = getSegments();

    StringBuilder builder = new StringBuilder();
    for (int i = 0; i < segments.size(); i++) {
      if (i > 0) {
        builder.append(".");
      }
      // Escape backslashes and backticks.
      String escaped = segments.get(i);
      escaped = escaped.replace("\\", "\\\\").replace("`", "\\`");

      if (!isValidIdentifier(escaped)) {
        escaped = '`' + escaped + '`';
      }

      builder.append(escaped);
    }
    return builder.toString();
  }
423447
def unindent(self):
        

        _logger().debug('unindent')
        cursor = self.editor.textCursor()
        _logger().debug('cursor has selection %r', cursor.hasSelection())
        if cursor.hasSelection():
            cursor.beginEditBlock()
            self.unindent_selection(cursor)
            cursor.endEditBlock()
            self.editor.setTextCursor(cursor)
        else:
            tab_len = self.editor.tab_length
            indentation = cursor.positionInBlock()
            indentation -= self.min_column
            if indentation == 0:
                return
            max_spaces = indentation % tab_len
            if max_spaces == 0:
                max_spaces = tab_len
            spaces = self.count_deletable_spaces(cursor, max_spaces)
            _logger().info('deleting %d space before cursor' % spaces)
            cursor.beginEditBlock()
            for _ in range(spaces):
                cursor.deletePreviousChar()
            cursor.endEditBlock()
            self.editor.setTextCursor(cursor)
            _logger().debug(cursor.block().text())
422597
protected function getIndentation()
    {
        if ($this->document) {
            if ($this->document->getConfig()->get(FormatterInterface::CFG_USE_TABS)) {
                $indentation = "\t";
            } else {
                $indentation = str_repeat(' ', $this->document->getConfig()->get(FormatterInterface::CFG_INDENTATION));
            }

            return str_repeat($indentation, $this->indentation);
        }
    }
1095149
public boolean skipSpaces ()
  {
    while (m_nPos < m_sValue.length () && m_sValue.charAt (m_nPos) == ' ')
      m_nPos++;
    return m_nPos < m_sValue.length ();
  }
803020
function () {
            var indentStr = '';
            for (var i = 0; i < indentLevel; i++) {
                indentStr += INDENT;
            }
            return {
                type: 'WhiteSpace',
                value: indentStr
            };
        }
655747
public int skipWhitespace() {
        for (int i = index; i < originalInput.length(); i++) {
            char ch = originalInput.charAt(i);
            if (Character.isSpaceChar(ch) ) {
                index++;
            } else {
                break;
            }
        }
        return index;
    }
1274050
def strip_indent(s, n) 
		i = 0
		while i < s.size && n>0
			c = s[i,1]
			if c == ' '
				n-=1;
			elsif c == "\t"
				n-=TabSize;
			else
				break
			end
			i+=1
		end
		s[i, s.size]
	end
494003
private StringBuilder spacer(final int spaces) {
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < spaces; i++) {
            sb.append(" ");
        }
        return sb;
    }
565940
public String scanFilterArgument() {
        if (end()) {
            return null;
        }

        int cp = string.codePointAt(pos);
        if (!Character.isJavaIdentifierStart(cp)) {
            return null;
        }

        int begin = pos;
        pos += Character.charCount(cp);

        for (; pos < string.length(); pos += Character.charCount(cp)) {
            cp = string.codePointAt(pos);
            if (!Character.isJavaIdentifierPart(cp) && cp != '.' && cp != '-') {
                break;
            }
        }

        return string.substring(begin, pos);
    }
211782
public static String tabsToSpaces(String in, int tabSize) {
        StringBuilder buf = new StringBuilder();
        int width = 0;
        for (int i = 0; i < in.length(); i++) {
            switch (in.charAt(i)) {
                case '\t':
                    int count = tabSize - (width % tabSize);
                    width += count;
                    while (--count >= 0) {
                        buf.append(' ');
                    }
                    break;
                case '\n':
                    width = 0;
                    buf.append(in.charAt(i));
                    break;
                default:
                    width++;
                    buf.append(in.charAt(i));
                    break;
            }
        }
        return buf.toString();
    }