diff options
author | Karl Williamson <khw@cpan.org> | 2017-01-12 14:59:45 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-02-20 01:37:23 -0700 |
commit | 25de47e3ad090ae552d3aca2ea84f1925227c4b5 (patch) | |
tree | ecb2a350a7f0e7f9fd78b310d3ac00af262f896c | |
parent | 54a4d58122fe7419254a10dc01459c2956767a30 (diff) | |
download | perl-25de47e3ad090ae552d3aca2ea84f1925227c4b5.tar.gz |
regcomp.c: Re-order branches
This will be useful in a future commit
-rw-r--r-- | regcomp.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -12350,8 +12350,6 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, return TRUE; } - /* Here, we have decided it should be a named character or sequence */ - /* The test above made sure that the next real character is a '{', but * under the /x modifier, it could be separated by space (or a comment and * \n) and this is not allowed (for consistency with \x{...} and the @@ -12366,16 +12364,8 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, if (! endbrace) { /* no trailing brace */ vFAIL2("Missing right brace on \\%c{}", 'N'); } - else if (!( endbrace == RExC_parse /* nothing between the {} */ - || memBEGINs(RExC_parse, /* U+ (bad hex is checked below - for a better error msg) */ - (STRLEN) (RExC_end - RExC_parse), - "U+"))) - { - RExC_parse = endbrace; /* position msg's '<--HERE' */ - vFAIL("\\N{NAME} must be resolved by the lexer"); - } + /* Here, we have decided it should be a named character or sequence */ REQUIRE_UNI_RULES(flagp, FALSE); /* Unicode named chars imply Unicode semantics */ @@ -12396,6 +12386,15 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, return TRUE; } + if (!(endbrace == RExC_parse /* nothing between the {} */ + || (endbrace - RExC_parse >= 2 /* U+ (bad hex is checked... */ + && strnEQ(RExC_parse, "U+", 2)))) /* ... below for a better + error msg) */ + { + RExC_parse = endbrace; /* position msg's '<--HERE' */ + vFAIL("\\N{NAME} must be resolved by the lexer"); + } + RExC_parse += 2; /* Skip past the 'U+' */ /* Because toke.c has generated a special construct for us guaranteed not |