This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(toke|regcomp).c: Use common fcn to handle \0 problems
[perl5.git] / dquote_inline.h
CommitLineData
f7e03a10
JH
1/* dquote_inline.h
2 *
3 * Copyright (C) 2015 by Larry Wall and others
4 *
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
7 */
8
6a5bc5ac
KW
9#ifndef PERL_DQUOTE_INLINE_H_ /* Guard against nested #inclusion */
10#define PERL_DQUOTE_INLINE_H_
f7e03a10
JH
11
12/*
13 - regcurly - a little FSA that accepts {\d+,?\d*}
14 Pulled from reg.c.
15 */
16PERL_STATIC_INLINE I32
17S_regcurly(const char *s)
18{
19 PERL_ARGS_ASSERT_REGCURLY;
20
21 if (*s++ != '{')
22 return FALSE;
23 if (!isDIGIT(*s))
24 return FALSE;
25 while (isDIGIT(*s))
26 s++;
27 if (*s == ',') {
28 s++;
29 while (isDIGIT(*s))
30 s++;
31 }
32
33 return *s == '}';
34}
35
6a5bc5ac 36#endif /* PERL_DQUOTE_INLINE_H_ */