Beispiel #1
0
	bool parse(scanner_t& scanner, skip_t&) const
	{
		for (int readChar = scanner.readAhead();
			 readChar != -1; readChar = scanner.readAhead())
		{
			if (!isSkipCharacter(readChar))
				break;

			scanner.skip(1);
		}

		return true;
	}
Beispiel #2
0
	bool parse(scanner_t& scanner, skip_t&) const
	{
		regex_match_t matcher_(matcher);

		if (matcher_.match(scanner.getRemainString()))
		{
			std::pair<size_t, size_t> position = matcher_.getCapture(0);
			if (position.first != 0)
				return false;

			scanner.skip(position.second);
			return true;
		}

		return false;
	}