summaryrefslogtreecommitdiff
path: root/libadhocutil/lexer-regex.h
blob: 3b8ca04c1a468f6b1b36e897a1edb07c28990511 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef ADHOCUTIL_LEXER_REGEX_H
#define ADHOCUTIL_LEXER_REGEX_H

#include "lexer.h" // IWYU pragma: export
#include "visibility.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#ifndef __clang__
#	pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
#include <glib.h>
#include <glibmm/ustring.h>
#pragma GCC diagnostic pop

namespace AdHoc::LexerMatchers {
	/**
	 * Create a AdHoc::Lexer pattern matcher using regexen.
	 * @param regex The regex string.
	 * @param compile The regex compile flags.
	 * @param match The regex match flags.
	 * @return Pointer to the newly created pattern matcher.
	 */
	DLL_PUBLIC Lexer::PatternPtr regex(
			const Glib::ustring & regex, GRegexCompileFlags compile = {}, GRegexMatchFlags match = {});
}

#endif