Commit | Line | Data |
---|---|---|
04e98a4d AD |
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 | ||
881ffab6 KW |
10 | #define PERL_IN_DQUOTE_STATIC_C |
11 | #include "proto.h" | |
12 | #include "embed.h" | |
13 | ||
04e98a4d AD |
14 | /* |
15 | - regcurly - a little FSA that accepts {\d+,?\d*} | |
16 | Pulled from regcomp.c. | |
17 | */ | |
04e98a4d | 18 | PERL_STATIC_INLINE I32 |
93df2d9c | 19 | S_regcurly(pTHX_ register const char *s) |
04e98a4d | 20 | { |
881ffab6 | 21 | PERL_ARGS_ASSERT_REGCURLY; |
04e98a4d AD |
22 | |
23 | if (*s++ != '{') | |
24 | return FALSE; | |
25 | if (!isDIGIT(*s)) | |
26 | return FALSE; | |
27 | while (isDIGIT(*s)) | |
28 | s++; | |
2ec31dd9 | 29 | if (*s == ',') { |
04e98a4d | 30 | s++; |
2ec31dd9 KW |
31 | while (isDIGIT(*s)) |
32 | s++; | |
33 | } | |
04e98a4d AD |
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 | */ |