diff options
author | trifon <trifon@yandex-team.ru> | 2022-02-10 16:50:51 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:51 +0300 |
commit | e3135d62bbcf321d86fff8258f5cdc5b2f57bde5 (patch) | |
tree | a5eeb758718dafefc9e215dae39f45cb61309f34 /library/cpp/uri/encodefsm.rl6 | |
parent | 252a6c9fbded23dfee8729dc34c97159962216a7 (diff) | |
download | ydb-e3135d62bbcf321d86fff8258f5cdc5b2f57bde5.tar.gz |
Restoring authorship annotation for <trifon@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/uri/encodefsm.rl6')
-rw-r--r-- | library/cpp/uri/encodefsm.rl6 | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/uri/encodefsm.rl6 b/library/cpp/uri/encodefsm.rl6 index 6a323aa85a3..b1cca61dafa 100644 --- a/library/cpp/uri/encodefsm.rl6 +++ b/library/cpp/uri/encodefsm.rl6 @@ -1,5 +1,5 @@ #include <library/cpp/uri/encode.h> - + #ifdef __clang__ #pragma clang diagnostic ignored "-Wunused-variable" #endif @@ -7,45 +7,45 @@ namespace NUri { namespace NEncode { -%%{ +%%{ machine TEncoder; - + hex = ( digit >{ HexDigit(fc); } | [A-F] >{ HexUpper(fc); } | [a-f] >{ HexLower(fc); } ); - + escaped = ( "%" hex hex ) > { HexReset(); } % { DoHex(); }; - + bad_escaped = ( "%" hex ) % { DoSym(*(fpc - 2)); DoSym(*(fpc - 1)); }; - + sym = (any - bad_escaped - escaped) %{ DoSym(*(fpc - 1)); }; - + main := ( escaped | bad_escaped | sym )**; write data; -}%% - +}%% + ui64 TEncoder::ReEncode(const TStringBuf &url) -{ +{ const char *p = url.data(); const char *pe = p + url.length(); const char *eof = pe; - int cs; + int cs; OutFlags = 0; - - %% write init; - %% write exec; + + %% write init; + %% write exec; return OutFlags; -} +} } } |