Skip to content

Commit 108b094

Browse files
authored
Merge pull request #49 from LunaStev/feature/ast
Change comment to English
2 parents decadaa + 0f4f304 commit 108b094

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/parser/parser.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ pub fn extract_body<'a>(tokens: &mut std::iter::Peekable<std::slice::Iter<'a, To
8585
}
8686
}
8787
_ => {
88-
// 처리되지 않은 토큰은 무시
88+
// Ignore unprocessed tokens
8989
}
9090
}
9191
}
9292

9393
body
9494
}
9595

96-
// PRINTLN 파싱
96+
// PRINTLN parsing
9797
fn parse_println(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option<ASTNode> {
9898
if let Some(Token { token_type: TokenType::LPAREN, .. }) = tokens.next() {
9999
if let Some(Token { token_type: TokenType::STRING(ref content), .. }) = tokens.next() {
@@ -105,7 +105,7 @@ fn parse_println(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> O
105105
None
106106
}
107107

108-
// PRINT 파싱
108+
// PRINT parsing
109109
fn parse_print(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option<ASTNode> {
110110
if let Some(Token { token_type: TokenType::LPAREN, .. }) = tokens.next() {
111111
if let Some(Token { token_type: TokenType::STRING(ref content), .. }) = tokens.next() {
@@ -117,10 +117,10 @@ fn parse_print(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Opt
117117
None
118118
}
119119

120-
// IF 파싱
120+
// IF parsing
121121
fn parse_if(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option<ASTNode> {
122122
if let Some(Token { token_type: TokenType::LPAREN, .. }) = tokens.next() {
123-
// 조건 추출 (간단히 처리)
123+
// Condition extraction (simple handling)
124124
let condition = if let Some(Token { lexeme, .. }) = tokens.next() {
125125
lexeme.clone()
126126
} else {
@@ -135,7 +135,7 @@ fn parse_if(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option
135135
None
136136
}
137137

138-
// FOR 파싱
138+
// FOR parsing
139139
fn parse_for(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option<ASTNode> {
140140
if let Some(Token { token_type: TokenType::LPAREN, .. }) = tokens.next() {
141141
let iterator = if let Some(Token { lexeme, .. }) = tokens.next() {
@@ -152,7 +152,7 @@ fn parse_for(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Optio
152152
None
153153
}
154154

155-
// WHILE 파싱
155+
// WHILE parsing
156156
fn parse_while(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option<ASTNode> {
157157
if let Some(Token { token_type: TokenType::LPAREN, .. }) = tokens.next() {
158158
let condition = if let Some(Token { lexeme, .. }) = tokens.next() {
@@ -169,18 +169,18 @@ fn parse_while(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Opt
169169
None
170170
}
171171

172-
// 블록 파싱
172+
// block parsing
173173
fn parse_block(tokens: &mut std::iter::Peekable<std::slice::Iter<Token>>) -> Option<Vec<ASTNode>> {
174174
if let Some(Token { token_type: TokenType::LBRACE, .. }) = tokens.next() {
175175
let mut body = vec![];
176176

177177
while let Some(token) = tokens.peek() {
178178
if let TokenType::RBRACE = token.token_type {
179-
tokens.next(); // } 소모
179+
tokens.next(); // } consumption
180180
break;
181181
}
182182

183-
body.extend(extract_body(tokens)); // 여기에서 수정한 부분
183+
body.extend(extract_body(tokens)); // The part that I modified here
184184
}
185185

186186
return Some(body);

0 commit comments

Comments
 (0)