Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL: Remove whitespace in csl files #350

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libmemcached/csl/common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Configure Scripting Language
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down
4 changes: 2 additions & 2 deletions libmemcached/csl/context.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Configure Scripting Language
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down Expand Up @@ -69,7 +69,7 @@ void Context::error(const char *error_arg, yytokentype last_token, const char *l
}

// We now test if it is something other then a syntax error, if it we
// return a generic message
// return a generic message
if (error_arg and strcmp(error_arg, "syntax error") == 0)
{ }
else if (error_arg)
Expand Down
6 changes: 3 additions & 3 deletions libmemcached/csl/context.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Configure Scripting Language
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down Expand Up @@ -116,13 +116,13 @@ class Context
memcached_return_t &rc;

protected:
void init_scanner();
void init_scanner();
void destroy_scanner();

private:
bool _is_server;
bool _end;
char _hostname[NI_MAXHOST];
};
};

#endif /* __LIBMEMCACHED_CSL_CONTEXT_H__ */
18 changes: 9 additions & 9 deletions libmemcached/csl/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* Configure Scripting Language
*
* Copyright (C) 2011 DataDifferental, http://datadifferential.com
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Expand Down Expand Up @@ -48,11 +48,11 @@

int conf_lex(YYSTYPE* lvalp, void* scanner);

#define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar
#define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar

#define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : ""

#define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)
#define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)

// This is bison calling error.
inline void __config_error(Context *context, yyscan_t *scanner, const char *error, int last_token, const char *last_token_str)
Expand Down Expand Up @@ -277,7 +277,7 @@ behaviors:
{
if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, $2)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);;
parser_abort(context, NULL);;
}
}
| behavior_number NUMBER
Expand Down Expand Up @@ -350,7 +350,7 @@ behavior_number:
}
;

behavior_boolean:
behavior_boolean:
BINARY_PROTOCOL
{
$$= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
Expand Down Expand Up @@ -478,9 +478,9 @@ distribution:
}
;

%%
%%

void Context::start()
void Context::start()
{
config_parse(this, (void **)scanner);
}
Expand Down
100 changes: 50 additions & 50 deletions libmemcached/csl/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* Configure Scripting Language
*
* Copyright (C) 2011 DataDifferental, http://datadifferential.com
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Expand Down Expand Up @@ -97,48 +97,48 @@

"--SOCKET=" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET; }

"--BINARY-PROTOCOL" { yyextra->begin= yytext; return yyextra->previous_token= BINARY_PROTOCOL; }
"--BUFFER-REQUESTS" { yyextra->begin= yytext; return yyextra->previous_token= BUFFER_REQUESTS; }
"--CONFIGURE-FILE=" { yyextra->begin= yytext; return yyextra->previous_token= CONFIGURE_FILE; }
"--CONNECT-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= CONNECT_TIMEOUT; }
"--DISTRIBUTION=" { yyextra->begin= yytext; return yyextra->previous_token= DISTRIBUTION; }
"--HASH-WITH-NAMESPACE" { yyextra->begin= yytext; return yyextra->previous_token= HASH_WITH_NAMESPACE; }
"--HASH=" { yyextra->begin= yytext; return yyextra->previous_token= HASH; }
"--IO-BYTES-WATERMARK=" { yyextra->begin= yytext; return yyextra->previous_token= IO_BYTES_WATERMARK; }
"--IO-KEY-PREFETCH=" { yyextra->begin= yytext; return yyextra->previous_token= IO_KEY_PREFETCH; }
"--IO-MSG-WATERMARK=" { yyextra->begin= yytext; return yyextra->previous_token= IO_MSG_WATERMARK; }
"--NOREPLY" { yyextra->begin= yytext; return yyextra->previous_token= NOREPLY; }
"--NUMBER-OF-REPLICAS=" { yyextra->begin= yytext; return yyextra->previous_token= NUMBER_OF_REPLICAS; }
"--POLL-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= POLL_TIMEOUT; }
"--RANDOMIZE-REPLICA-READ" { yyextra->begin= yytext; return yyextra->previous_token= RANDOMIZE_REPLICA_READ; }
"--RCV-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= RCV_TIMEOUT; }
"--REMOVE-FAILED-SERVERS=" { yyextra->begin= yytext; return yyextra->previous_token= REMOVE_FAILED_SERVERS; }
"--RETRY-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= RETRY_TIMEOUT; }
"--SND-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= SND_TIMEOUT; }
"--SOCKET-RECV-SIZE=" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET_RECV_SIZE; }
"--SOCKET-SEND-SIZE=" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET_SEND_SIZE; }
"--SORT-HOSTS" { yyextra->begin= yytext; return yyextra->previous_token= SORT_HOSTS; }
"--SUPPORT-CAS" { yyextra->begin= yytext; return yyextra->previous_token= SUPPORT_CAS; }
"--TCP-KEEPALIVE" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_KEEPALIVE; }
"--TCP-KEEPIDLE" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_KEEPIDLE; }
"--TCP-NODELAY" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_NODELAY; }
"--USE-UDP" { yyextra->begin= yytext; return yyextra->previous_token= USE_UDP; }
"--USER-DATA" { yyextra->begin= yytext; return yyextra->previous_token= USER_DATA; }
"--VERIFY-KEY" { yyextra->begin= yytext; return yyextra->previous_token= VERIFY_KEY; }

"--POOL-MIN=" { yyextra->begin= yytext; return yyextra->previous_token= POOL_MIN; }
"--POOL-MAX=" { yyextra->begin= yytext; return yyextra->previous_token= POOL_MAX; }

"--NAMESPACE=" { yyextra->begin= yytext; return yyextra->previous_token= NAMESPACE; }

INCLUDE { yyextra->begin= yytext; return yyextra->previous_token= INCLUDE; }
"--BINARY-PROTOCOL" { yyextra->begin= yytext; return yyextra->previous_token= BINARY_PROTOCOL; }
"--BUFFER-REQUESTS" { yyextra->begin= yytext; return yyextra->previous_token= BUFFER_REQUESTS; }
"--CONFIGURE-FILE=" { yyextra->begin= yytext; return yyextra->previous_token= CONFIGURE_FILE; }
"--CONNECT-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= CONNECT_TIMEOUT; }
"--DISTRIBUTION=" { yyextra->begin= yytext; return yyextra->previous_token= DISTRIBUTION; }
"--HASH-WITH-NAMESPACE" { yyextra->begin= yytext; return yyextra->previous_token= HASH_WITH_NAMESPACE; }
"--HASH=" { yyextra->begin= yytext; return yyextra->previous_token= HASH; }
"--IO-BYTES-WATERMARK=" { yyextra->begin= yytext; return yyextra->previous_token= IO_BYTES_WATERMARK; }
"--IO-KEY-PREFETCH=" { yyextra->begin= yytext; return yyextra->previous_token= IO_KEY_PREFETCH; }
"--IO-MSG-WATERMARK=" { yyextra->begin= yytext; return yyextra->previous_token= IO_MSG_WATERMARK; }
"--NOREPLY" { yyextra->begin= yytext; return yyextra->previous_token= NOREPLY; }
"--NUMBER-OF-REPLICAS=" { yyextra->begin= yytext; return yyextra->previous_token= NUMBER_OF_REPLICAS; }
"--POLL-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= POLL_TIMEOUT; }
"--RANDOMIZE-REPLICA-READ" { yyextra->begin= yytext; return yyextra->previous_token= RANDOMIZE_REPLICA_READ; }
"--RCV-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= RCV_TIMEOUT; }
"--REMOVE-FAILED-SERVERS=" { yyextra->begin= yytext; return yyextra->previous_token= REMOVE_FAILED_SERVERS; }
"--RETRY-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= RETRY_TIMEOUT; }
"--SND-TIMEOUT=" { yyextra->begin= yytext; return yyextra->previous_token= SND_TIMEOUT; }
"--SOCKET-RECV-SIZE=" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET_RECV_SIZE; }
"--SOCKET-SEND-SIZE=" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET_SEND_SIZE; }
"--SORT-HOSTS" { yyextra->begin= yytext; return yyextra->previous_token= SORT_HOSTS; }
"--SUPPORT-CAS" { yyextra->begin= yytext; return yyextra->previous_token= SUPPORT_CAS; }
"--TCP-KEEPALIVE" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_KEEPALIVE; }
"--TCP-KEEPIDLE" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_KEEPIDLE; }
"--TCP-NODELAY" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_NODELAY; }
"--USE-UDP" { yyextra->begin= yytext; return yyextra->previous_token= USE_UDP; }
"--USER-DATA" { yyextra->begin= yytext; return yyextra->previous_token= USER_DATA; }
"--VERIFY-KEY" { yyextra->begin= yytext; return yyextra->previous_token= VERIFY_KEY; }

"--POOL-MIN=" { yyextra->begin= yytext; return yyextra->previous_token= POOL_MIN; }
"--POOL-MAX=" { yyextra->begin= yytext; return yyextra->previous_token= POOL_MAX; }

"--NAMESPACE=" { yyextra->begin= yytext; return yyextra->previous_token= NAMESPACE; }

INCLUDE { yyextra->begin= yytext; return yyextra->previous_token= INCLUDE; }
RESET { yyextra->begin= yytext; return yyextra->previous_token= RESET; }
DEBUG { yyextra->begin= yytext; return yyextra->previous_token= PARSER_DEBUG; }
SERVERS { yyextra->begin= yytext; return yyextra->previous_token= SERVERS; }
END { yyextra->begin= yytext; return yyextra->previous_token= END; }
SERVERS { yyextra->begin= yytext; return yyextra->previous_token= SERVERS; }
END { yyextra->begin= yytext; return yyextra->previous_token= END; }
ERROR { yyextra->begin= yytext; return yyextra->previous_token= ERROR; }

TRUE { return yyextra->previous_token= TRUE; }
TRUE { return yyextra->previous_token= TRUE; }
FALSE { return yyextra->previous_token= FALSE; }


Expand All @@ -151,15 +151,15 @@ CONSISTENT { return CONSISTENT; }
MODULA { return MODULA; }
RANDOM { return RANDOM; }

MD5 { return MD5; }
CRC { return CRC; }
FNV1_64 { return FNV1_64; }
FNV1A_64 { return FNV1A_64; }
FNV1_32 { return FNV1_32; }
FNV1A_32 { return FNV1A_32; }
HSIEH { return HSIEH; }
MURMUR { return MURMUR; }
JENKINS { return JENKINS; }
MD5 { return MD5; }
CRC { return CRC; }
FNV1_64 { return FNV1_64; }
FNV1A_64 { return FNV1A_64; }
FNV1_32 { return FNV1_32; }
FNV1A_32 { return FNV1A_32; }
HSIEH { return HSIEH; }
MURMUR { return MURMUR; }
JENKINS { return JENKINS; }

(([[:digit:]]{1,3}"."){3}([[:digit:]]{1,3})) {
yylval->server.port= MEMCACHED_DEFAULT_PORT;
Expand Down
2 changes: 1 addition & 1 deletion libmemcached/csl/server.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Configure Scripting Language
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down
4 changes: 2 additions & 2 deletions libmemcached/csl/symbol.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Configure Scripting Language
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down Expand Up @@ -44,7 +44,7 @@

union YYSTYPE
{
long long number;
long long number;
memcached_string_t string;
memcached_string_t option;
double double_number;
Expand Down
Loading