1
0

Complete string to list conversion with as

This commit is contained in:
Jeff 2024-02-13 10:36:43 -05:00
parent 18508fa217
commit 52493a0b73
2 changed files with 7 additions and 8 deletions

View File

@ -34,7 +34,7 @@ impl AbstractTree for As {
Ok(self.r#type.clone()) Ok(self.r#type.clone())
} }
fn validate(&self, source: &str, context: &Context) -> Result<(), ValidationError> { fn validate(&self, _source: &str, context: &Context) -> Result<(), ValidationError> {
let expected_type = self.expression.expected_type(context)?; let expected_type = self.expression.expected_type(context)?;
if let Type::List(item_type) = &self.r#type { if let Type::List(item_type) = &self.r#type {
@ -48,20 +48,20 @@ impl AbstractTree for As {
}); });
} }
} }
Type::String => {}
Type::Any => todo!(), Type::Any => todo!(),
Type::Boolean => todo!(), Type::Boolean => todo!(),
Type::Collection => todo!(), Type::Collection => todo!(),
Type::Custom(_) => todo!(), Type::Custom(_) => todo!(),
Type::Float => todo!(), Type::Float => todo!(),
Type::Function { Type::Function {
parameter_types, parameter_types: _,
return_type, return_type: _,
} => todo!(), } => todo!(),
Type::Integer => todo!(), Type::Integer => todo!(),
Type::Map(_) => todo!(), Type::Map(_) => todo!(),
Type::None => todo!(), Type::None => todo!(),
Type::Number => todo!(), Type::Number => todo!(),
Type::String => todo!(),
Type::Range => todo!(), Type::Range => todo!(),
Type::Option(_) => todo!(), Type::Option(_) => todo!(),
} }
@ -101,7 +101,7 @@ impl AbstractTree for As {
} }
impl Format for As { impl Format for As {
fn format(&self, output: &mut String, indent_level: u8) { fn format(&self, _output: &mut String, _indent_level: u8) {
todo!() todo!()
} }
} }

View File

@ -4,9 +4,8 @@ use clap::{Parser, Subcommand};
use crossterm::event::{KeyCode, KeyModifiers}; use crossterm::event::{KeyCode, KeyModifiers};
use nu_ansi_term::{Color, Style}; use nu_ansi_term::{Color, Style};
use reedline::{ use reedline::{
default_emacs_keybindings, ColumnarMenu, Completer, DefaultHinter, EditCommand, Emacs, default_emacs_keybindings, ColumnarMenu, Completer, DefaultHinter, EditCommand, Emacs, Prompt,
Highlighter, Prompt, Reedline, ReedlineEvent, ReedlineMenu, Signal, Span, SqliteBackedHistory, Reedline, ReedlineEvent, ReedlineMenu, Signal, Span, SqliteBackedHistory, Suggestion,
StyledText, Suggestion,
}; };
use std::{borrow::Cow, fs::read_to_string, path::PathBuf, process::Command}; use std::{borrow::Cow, fs::read_to_string, path::PathBuf, process::Command};