-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
libmemcached/csl/parser.cc
Outdated
@@ -91,11 +91,11 @@ | |||
|
|||
int conf_lex(YYSTYPE* lvalp, void* scanner); | |||
|
|||
#define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ing-eoking @namsic
generated code 까지 수정해야 하나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성된 코드를 직접 수정하기보다는 원본 source를 수정하여 재생성하는 형태이면 좋을텐데요.
현재 arcus-c-client는 생성된 .cc
파일을 관리하고 있으므로 generated code이더라도 수정하는 것이 좋겠습니다.
@ing-eoking
parser.cc는 parser.yy를 기반으로 생성한 파일인 것으로 알고 있는데,
두 파일의 수정 사항에 차이가 생기는 이유는 무엇인지 아나요?
.yy에 의해 생성된 .cc 파일을 생성 후 임의로 수정했기 때문일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser.cc/h
scanner.cc/h 파일은 제외해도 될 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아무래도 generated code는 예외로 하면 좋겠습니다.
원본 soruce를 수정하여 다시 generate하는 것이 하나의 방안인 데,
이 부분에 대해서는 검증이 필요할 것이라 생각됩니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제외되었습니다.
libmemcached/csl/parser.cc
Outdated
@@ -91,11 +91,11 @@ | |||
|
|||
int conf_lex(YYSTYPE* lvalp, void* scanner); | |||
|
|||
#define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성된 코드를 직접 수정하기보다는 원본 source를 수정하여 재생성하는 형태이면 좋을텐데요.
현재 arcus-c-client는 생성된 .cc
파일을 관리하고 있으므로 generated code이더라도 수정하는 것이 좋겠습니다.
@ing-eoking
parser.cc는 parser.yy를 기반으로 생성한 파일인 것으로 알고 있는데,
두 파일의 수정 사항에 차이가 생기는 이유는 무엇인지 아나요?
.yy에 의해 생성된 .cc 파일을 생성 후 임의로 수정했기 때문일까요?
libmemcached/csl/parser.am
Outdated
@@ -0,0 +1 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일은 어떤 파일인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아무 동작은 하지 않으나 빌드 과정에만 포함시키고 있는 파일입니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일은 수정할 필요가 없습니다.
libmemcached/csl/scanner.h
Outdated
@@ -208,57 +208,57 @@ typedef size_t yy_size_t; | |||
#ifndef YY_STRUCT_YY_BUFFER_STATE | |||
#define YY_STRUCT_YY_BUFFER_STATE | |||
struct yy_buffer_state | |||
{ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8칸 indent 사용하나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace를 제거하는 스크립트를 실행할 때, 4칸 indent를 사용했지만 모든 라인이 일정한 Whitespace를 갖고 있지 않은 것 같아 직접 수정했습니다.
libmemcached/csl/scanner.l
Outdated
"--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; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시작 위치 맞추려 했던 것이 아닌지?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확실치는 않으나 INCLUDE, RESET 등의 라인에서 시작 위치가 서로 다르게 설정되어 있는 것으로보아 모든 부분이 일정하게 맞춰진 것 같지는 않습니다. vi 편집기에서 확인했을 때, 작성자가 원래 의도한 모습에 더 가까운 형태로 보였기 때문에 그렇게 변경했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 전체적으로 맞추어주죠.
- 시작 위치
- 기타 사항 (가급적 tab은 2개 space)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정되었습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 완료
libmemcached/csl/parser.am
Outdated
@@ -0,0 +1 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일은 수정할 필요가 없습니다.
libmemcached/csl/scanner.l
Outdated
"--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; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 전체적으로 맞추어주죠.
- 시작 위치
- 기타 사항 (가급적 tab은 2개 space)
🔗 Related Issue
⌨️ What I did