示例#1
0
文件: Parser.hpp 项目: rayfill/cpplib
	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;
	}
示例#2
0
文件: Parser.hpp 项目: rayfill/cpplib
	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;
	}