This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_regcurly needs thread context.
[perl5.git] / dquote_static.c
... / ...
CommitLineData
1/* dquote_static.c
2 *
3 * This file contains static inline functions that are related to
4 * parsing double-quotish expressions, but are used in more than
5 * one file.
6 *
7 * It is currently #included by regcomp.c and toke.c.
8*/
9
10#define PERL_IN_DQUOTE_STATIC_C
11#include "proto.h"
12#include "embed.h"
13
14/*
15 - regcurly - a little FSA that accepts {\d+,?\d*}
16 Pulled from regcomp.c.
17 */
18PERL_STATIC_INLINE I32
19S_regcurly(pTHX_ register const char *s)
20{
21 PERL_ARGS_ASSERT_REGCURLY;
22
23 if (*s++ != '{')
24 return FALSE;
25 if (!isDIGIT(*s))
26 return FALSE;
27 while (isDIGIT(*s))
28 s++;
29 if (*s == ',') {
30 s++;
31 while (isDIGIT(*s))
32 s++;
33 }
34 if (*s != '}')
35 return FALSE;
36 return TRUE;
37}
38/*
39 * Local variables:
40 * c-indentation-style: bsd
41 * c-basic-offset: 4
42 * indent-tabs-mode: t
43 * End:
44 *
45 * ex: set ts=8 sts=4 sw=4 noet:
46 */