We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a547d3e commit 5309e18Copy full SHA for 5309e18
src/main.rs
@@ -256,14 +256,14 @@ impl Executor {
256
257
// 文字列をスタックに積む
258
let chars: Vec<char> = token.chars().collect();
259
- if chars[0] == '(' || chars[chars.len() - 1] == ')' {
+ if chars[0] == '(' && chars[chars.len() - 1] == ')' {
260
self.stack
261
.push(Type::String(token[1..token.len() - 1].to_string()));
262
continue;
263
}
264
265
// リストを処理
266
- if chars[0] == '[' || chars[chars.len() - 1] == ']' {
+ if chars[0] == '[' && chars[chars.len() - 1] == ']' {
267
let old_len = self.stack.len();
268
let slice = &token[1..token.len() - 1];
269
let token: Vec<_> = slice.split_whitespace().map(|x| x.to_string()).collect();
0 commit comments