private int tryNumericLiteral(final String text, final int start,
			final int length) {

		boolean seenDecimalPoint = false;
		int lastDigit = start - 1;

		int position = start;
		while (position < length) {
			final char c = text.charAt(position);
			if (isDigit(c)) {
				lastDigit = position;
				position += 1;
				continue;
			}

			if (c == '.' || c == ',') {
				if (seenDecimalPoint) {
					break;
				}

				seenDecimalPoint = true;
				position += 1;
				continue;
			}

			// Not a valid character for a number.
			break;
		}

		if (position == start) {
			// No match.
			return 0;
		}

		return lastDigit - start + 1;
	}