We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72906cd commit 0522886Copy full SHA for 0522886
.github/workflows/rustdoc.yml
@@ -17,7 +17,7 @@ on:
17
- 'Cargo.toml'
18
- 'Cargo.lock'
19
- '.github/**'
20
-
+
21
env:
22
CARGO_TERM_COLOR: always
23
zenlang/src/vm/vm_opcode.rs
@@ -175,6 +175,16 @@ impl VM {
175
return;
176
}
177
178
+ Value::String(string) => {
179
+ if let Value::Number(index) = index {
180
+ if let Some(ch) = string.chars().nth(index as usize) {
181
+ self.stack.push(Value::String(String::from(ch)));
182
+ } else {
183
+ self.stack.push(Value::Null());
184
+ }
185
+ return;
186
187
188
_ => {}
189
190
self.error = format!("iafs failed: invalid operand types");
0 commit comments