diff options
author | Freya Murphy <freya@freyacat.org> | 2024-02-29 17:04:28 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-02-29 17:04:28 -0500 |
commit | 5d2747e26f51cc2344a6bd95f93457248fdfebd8 (patch) | |
tree | 8755b4068166c3854d26817683ce438a771ab319 /matrix-bin/src/helper.rs | |
parent | more mat, sys, and os stdlib functions, better matrix printing, other fixes (diff) | |
download | matrix-5d2747e26f51cc2344a6bd95f93457248fdfebd8.tar.gz matrix-5d2747e26f51cc2344a6bd95f93457248fdfebd8.tar.bz2 matrix-5d2747e26f51cc2344a6bd95f93457248fdfebd8.zip |
fin prob
Diffstat (limited to 'matrix-bin/src/helper.rs')
-rw-r--r-- | matrix-bin/src/helper.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/matrix-bin/src/helper.rs b/matrix-bin/src/helper.rs index 95e0848..df40946 100644 --- a/matrix-bin/src/helper.rs +++ b/matrix-bin/src/helper.rs @@ -1,7 +1,6 @@ use std::{borrow::Cow, rc::Rc, cell::RefCell}; - -use matrix::{lex::{Lexer, TokenData, Token}, vm::Vm}; use rustyline::{validate::{Validator, ValidationResult, ValidationContext}, highlight::Highlighter, Helper, Hinter, completion::Completer}; +use matrix_lang::prelude::*; #[derive(Helper, Hinter)] pub struct MatrixHelper { @@ -205,6 +204,7 @@ impl Highlighter for MatrixHelper { T::Else | T::While | T::Let | + T::Const | T::Function | T::Continue | T::Break | @@ -290,12 +290,12 @@ impl Completer for MatrixHelper { } let _ = (line, pos, ctx); - let globals = self.vm.borrow().global_names(); + let globals = self.vm.borrow().globals(); let names: Vec<Rc<str>> = globals .borrow() .clone() .into_iter() - .filter(|n| n.starts_with(&buf)) + .filter_map(|n| if n.name.starts_with(&buf) { Some(n.name.clone()) } else { None }) .collect(); if buf.is_empty() { |