mirror of
https://github.com/nushell/nushell
synced 2025-01-07 10:49:03 +00:00
25 lines
634 B
Rust
25 lines
634 B
Rust
|
use std::sync::Arc;
|
||
|
|
||
|
use crate::{Block, Expr, Expression, ParserState, ParserWorkingSet, Statement};
|
||
|
|
||
|
fn syntax_highlight(parser_state: Arc<ParserState>, input: &[u8]) {
|
||
|
let mut working_set = ParserWorkingSet::new(Some(parser_state));
|
||
|
|
||
|
let (block, _) = working_set.parse_source(input, false);
|
||
|
|
||
|
// for stmt in &block.stmts {
|
||
|
// match stmt {
|
||
|
// Statement::Expression(expr) => {
|
||
|
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// No merge at the end because this parse is speculative
|
||
|
}
|
||
|
|
||
|
fn highlight_expression(expression: &Expression) {
|
||
|
// match &expression.expr {
|
||
|
// Expr::BinaryOp()
|
||
|
// }
|
||
|
}
|