Browse Source

Fix strings in array

github-actions v0.0.2
Garrit Franke 3 years ago
parent
commit
06588aa272
  1. 2
      build_docs.py
  2. 3
      src/parser/rules.rs
  3. 1
      src/parser/tests.rs

2
build_docs.py

@ -1,7 +1,7 @@
import subprocess import subprocess
import os import os
os.system("mdbook build --dest-dir './book") os.system("mdbook build --dest-dir './book'")
os.system("mdbook build --dest-dir './book/latest'") os.system("mdbook build --dest-dir './book/latest'")
tags = subprocess.run(["git", "tag"], stdout=subprocess.PIPE).stdout.decode('utf-8') tags = subprocess.run(["git", "tag"], stdout=subprocess.PIPE).stdout.decode('utf-8')

3
src/parser/rules.rs

@ -201,6 +201,9 @@ impl Parser {
let value = next.raw.parse::<u32>().map_err(|e| e.to_string())?; let value = next.raw.parse::<u32>().map_err(|e| e.to_string())?;
elements.push(Expression::Int(value)); elements.push(Expression::Int(value));
} }
TokenKind::Literal(Value::Str) => {
elements.push(Expression::Str(next.raw));
}
_ => return Err(self.make_error(TokenKind::Identifier("Argument".into()), next)), _ => return Err(self.make_error(TokenKind::Identifier("Argument".into()), next)),
}; };
if self.peek_token(TokenKind::SquareBraceClose).is_ok() { if self.peek_token(TokenKind::SquareBraceClose).is_ok() {

1
src/parser/tests.rs

@ -366,7 +366,6 @@ fn test_int_array() {
} }
#[test] #[test]
#[ignore]
fn test_string_array() { fn test_string_array() {
let raw = " let raw = "
fn main(n) { fn main(n) {

Loading…
Cancel
Save