aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/uri/encodefsm.rl6
diff options
context:
space:
mode:
authortrifon <trifon@yandex-team.ru>2022-02-10 16:50:51 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:51 +0300
commitdd6b55b11723e4bb5b0cf7bffc0e45f15e2e46d3 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/uri/encodefsm.rl6
parente3135d62bbcf321d86fff8258f5cdc5b2f57bde5 (diff)
downloadydb-dd6b55b11723e4bb5b0cf7bffc0e45f15e2e46d3.tar.gz
Restoring authorship annotation for <trifon@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/uri/encodefsm.rl6')
-rw-r--r--library/cpp/uri/encodefsm.rl630
1 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/uri/encodefsm.rl6 b/library/cpp/uri/encodefsm.rl6
index b1cca61dafa..6a323aa85a3 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;
-}
+}
}
}