-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#145] handle_insert_query 테스트 리팩토링 및 버그 수정, 테스트케이스 추가 #147
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
80fa71d
[#145] handle_insert_query 테스트 리팩토링 및 버그 수정
myyrakle a4bd21a
[#145] insert_query 테스트케이스 추가 및 버그 수정
myyrakle 7eb0f50
[#145] insert_query 테스트케이스 보완
myyrakle 5516e1e
[#145] parse_insert_columns 테스트코드 작성
myyrakle 7007cab
[#145] parse_insert_columns 리팩토링
myyrakle 5d181a0
[#145] parse_insert_values 테스트코드 작성
myyrakle e9ef65d
[#145] parse_insert_values 테스트코드 추가
myyrakle 38fc2b6
[#145] parse_insert_values 버그 수정
myyrakle 492fca2
[#145] parse_insert_values 커버리지 보완
myyrakle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,10 @@ impl Parser { | |
} | ||
|
||
// INTO 토큰 삼키기 | ||
if !self.has_next_token() { | ||
return Err(ParsingError::wrap("E0410 need more tokens")); | ||
} | ||
|
||
let current_token = self.get_next_token(); | ||
if current_token != Token::Into { | ||
return Err(ParsingError::wrap("E0403 expected INTO")); | ||
|
@@ -124,8 +128,7 @@ impl Parser { | |
continue; | ||
} | ||
Token::RightParentheses => { | ||
self.unget_next_token(current_token); | ||
break; | ||
return Ok(names); | ||
} | ||
_ => { | ||
return Err(ParsingError::wrap(format!( | ||
|
@@ -135,17 +138,6 @@ impl Parser { | |
} | ||
} | ||
} | ||
|
||
let current_token = self.get_next_token(); | ||
|
||
if current_token != Token::RightParentheses { | ||
return Err(ParsingError::wrap(format!( | ||
"E0408 expected ')'. but your input word is '{:?}'", | ||
current_token | ||
))); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 불필요한 지연처리 빼고 match절에서 즉시리턴 |
||
|
||
Ok(names) | ||
} | ||
|
||
// Values 절 파싱 | ||
|
@@ -181,8 +173,10 @@ impl Parser { | |
let current_token = self.get_next_token(); | ||
|
||
if current_token != Token::LeftParentheses { | ||
self.unget_next_token(current_token); | ||
break; | ||
return Err(ParsingError::wrap(format!( | ||
"E0417 expected '('. but your input word is '{:?}'", | ||
current_token | ||
))); | ||
} | ||
|
||
if !self.has_next_token() { | ||
|
@@ -220,7 +214,7 @@ impl Parser { | |
} | ||
|
||
// 쉼표가 있으면 삼키기 | ||
if self.pick_next_token() == Token::Comma { | ||
if self.has_next_token() && self.pick_next_token() == Token::Comma { | ||
self.get_next_token(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 버그 수정 |
||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
패닉케이스 제거