Improve highlighting

This commit is contained in:
Yehuda Katz 2019-05-31 09:33:46 -07:00
parent 9e9c0b9811
commit b319381d84
4 changed files with 102 additions and 113 deletions

View File

@ -339,7 +339,6 @@ impl SpannedToken<'source> {
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Debug, Clone, Eq, PartialEq)]
pub enum Token { pub enum Token {
Variable, Variable,
Dot,
PathDot, PathDot,
Member, Member,
Num, Num,
@ -561,9 +560,6 @@ mod tests {
impl TestToken<'source> { impl TestToken<'source> {
fn to_token(&self, range: &std::ops::Range<usize>) -> SpannedToken<'source> { fn to_token(&self, range: &std::ops::Range<usize>) -> SpannedToken<'source> {
match self.desc { match self.desc {
TokenDesc::Top(TopToken::Dot) => {
SpannedToken::new(Span::new(range), self.source, Token::Dot)
}
TokenDesc::Top(tok) => { TokenDesc::Top(tok) => {
SpannedToken::new(Span::new(range), self.source, tok.to_token().unwrap()) SpannedToken::new(Span::new(range), self.source, tok.to_token().unwrap())
} }

View File

@ -105,7 +105,6 @@ extern {
type Error = ShellError; type Error = ShellError;
enum SpannedToken<'input> { enum SpannedToken<'input> {
"." => SpannedToken { token: Token::Dot, .. },
"|" => SpannedToken { token: Token::Pipe, .. }, "|" => SpannedToken { token: Token::Pipe, .. },
"(" => SpannedToken { token: Token::OpenParen, .. }, "(" => SpannedToken { token: Token::OpenParen, .. },
")" => SpannedToken { token: Token::CloseParen, .. }, ")" => SpannedToken { token: Token::CloseParen, .. },

View File

@ -1,5 +1,5 @@
// auto-generated: "lalrpop 0.17.0" // auto-generated: "lalrpop 0.17.0"
// sha256: 7d24b7dfd8aaad128886f4926feedaf9a21057b08de7f4e587cd977890a65a // sha256: c7eac268e354044ccb73aea4829c2dbd02ae11ce74a7dc33b74944ec862f9
#![allow(unused)] #![allow(unused)]
use std::str::FromStr; use std::str::FromStr;
use crate::parser::ast::*; use crate::parser::ast::*;
@ -43,137 +43,137 @@ mod __parse__Pipeline {
} }
const __ACTION: &'static [i8] = &[ const __ACTION: &'static [i8] = &[
// State 0 // State 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 1 // State 1
0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, -19, 0, 0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, -19, 0,
// State 2 // State 2
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0,
// State 3 // State 3
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 4 // State 4
-14, -14, -14, -14, -14, -14, 0, -14, -14, -14, -14, -14, 32, -14, -14, 0, -14, 0, -14, 0, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 32, -14, -14, 0, -14, 0, -14, 0, -14, -14, -14,
// State 5 // State 5
-51, -51, -51, -51, -51, -51, 0, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, 0, -51, 0, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, 0, -51, 0, -51, -51, -51,
// State 6 // State 6
-44, -44, -44, -44, -44, -44, 0, -44, -44, -44, -44, -44, 0, -44, -44, 0, -44, 0, -44, 0, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, 0, -44, -44, 0, -44, 0, -44, 0, -44, -44, -44,
// State 7 // State 7
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0,
// State 8 // State 8
-52, -52, -52, -52, -52, -52, 0, -52, -52, -52, -52, -52, -52, -52, -52, 0, -52, 0, -52, 0, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, 0, -52, 0, -52, 0, -52, -52, -52,
// State 9 // State 9
34, -24, -24, 0, -24, -24, 0, 35, 36, 37, 38, 39, 0, -24, -24, 0, -24, 0, -24, 0, -24, -24, 0, 34, -24, -24, 0, -24, -24, 35, 36, 37, 38, 39, 0, -24, -24, 0, -24, 0, -24, 0, -24, -24, 0,
// State 10 // State 10
0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, -20, 0, 0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, -20, 0,
// State 11 // State 11
-45, -45, -45, -45, -45, -45, 0, -45, -45, -45, -45, -45, 0, -45, -45, 0, -45, 0, -45, 0, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, 0, -45, -45, 0, -45, 0, -45, 0, -45, -45, -45,
// State 12 // State 12
-30, -30, -30, -30, -30, -30, 0, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, 0, -30, 0, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, 0, -30, 0, -30, -30, -30,
// State 13 // State 13
-13, -13, -13, -13, -13, -13, 0, -13, -13, -13, -13, -13, -13, -13, -13, 0, -13, 0, -13, 0, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 0, -13, 0, -13, 0, -13, -13, -13,
// State 14 // State 14
-12, -12, -12, -12, -12, -12, 0, -12, -12, -12, -12, -12, -12, -12, -12, 0, -12, 0, -12, 0, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 0, -12, 0, -12, 0, -12, -12, -12,
// State 15 // State 15
-22, -22, -22, -22, -22, -22, 0, -22, -22, -22, -22, -22, 0, -22, -22, 0, -22, 0, -22, 0, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 0, -22, -22, 0, -22, 0, -22, 0, -22, -22, -22,
// State 16 // State 16
-23, -23, -23, -23, -23, -23, 0, -23, -23, -23, -23, -23, 0, -23, -23, 0, -23, 0, -23, 0, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 0, -23, -23, 0, -23, 0, -23, 0, -23, -23, -23,
// State 17 // State 17
-29, -29, -29, -29, -29, -29, 0, -29, -29, -29, -29, -29, -29, -29, -29, 0, -29, 0, -29, 0, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 0, -29, 0, -29, 0, -29, -29, -29,
// State 18 // State 18
-31, -31, -31, -31, -31, -31, 0, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, 0, -31, 0, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, 0, -31, 0, -31, -31, -31,
// State 19 // State 19
-43, -43, -43, -43, -43, -43, 0, -43, -43, -43, -43, -43, 42, -43, -43, 0, -43, 0, -43, 0, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, 42, -43, -43, 0, -43, 0, -43, 0, -43, -43, -43,
// State 20 // State 20
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
// State 21 // State 21
0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, 0, 0, 0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, 0, 0,
// State 22 // State 22
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 23 // State 23
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 24 // State 24
-49, -49, -49, -49, -49, -49, 0, -49, -49, -49, -49, -49, -49, -49, -49, 0, -49, 0, -49, 0, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, 0, -49, 0, -49, 0, -49, -49, -49,
// State 25 // State 25
-28, -28, -28, -28, -28, -28, 0, -28, -28, -28, -28, -28, -28, -28, -28, 0, -28, 0, -28, 0, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, 0, -28, 0, -28, 0, -28, -28, -28,
// State 26 // State 26
-48, -48, -48, -48, -48, -48, 0, -48, -48, -48, -48, -48, -48, -48, -48, 0, -48, 0, -48, 0, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, 0, -48, 0, -48, 0, -48, -48, -48,
// State 27 // State 27
0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, 0, 0, 0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, 0, 0,
// State 28 // State 28
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0,
// State 29 // State 29
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 30 // State 30
-15, -15, -15, -15, -15, -15, 0, -15, -15, -15, -15, -15, 53, -15, -15, 0, -15, 0, -15, 0, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, 53, -15, -15, 0, -15, 0, -15, 0, -15, -15, -15,
// State 31 // State 31
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0,
// State 32 // State 32
0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, 0, 0, 0, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 5, 25, 0, 26, 0, 27, 0, 28, 0, 0,
// State 33 // State 33
0, -35, -35, 0, -35, -35, 0, 0, 0, 0, 0, 0, 0, -35, -35, 0, -35, 0, -35, 0, -35, 0, 0, 0, -35, -35, 0, -35, -35, 0, 0, 0, 0, 0, 0, -35, -35, 0, -35, 0, -35, 0, -35, 0, 0,
// State 34 // State 34
0, -36, -36, 0, -36, -36, 0, 0, 0, 0, 0, 0, 0, -36, -36, 0, -36, 0, -36, 0, -36, 0, 0, 0, -36, -36, 0, -36, -36, 0, 0, 0, 0, 0, 0, -36, -36, 0, -36, 0, -36, 0, -36, 0, 0,
// State 35 // State 35
0, -38, -38, 0, -38, -38, 0, 0, 0, 0, 0, 0, 0, -38, -38, 0, -38, 0, -38, 0, -38, 0, 0, 0, -38, -38, 0, -38, -38, 0, 0, 0, 0, 0, 0, -38, -38, 0, -38, 0, -38, 0, -38, 0, 0,
// State 36 // State 36
0, -34, -34, 0, -34, -34, 0, 0, 0, 0, 0, 0, 0, -34, -34, 0, -34, 0, -34, 0, -34, 0, 0, 0, -34, -34, 0, -34, -34, 0, 0, 0, 0, 0, 0, -34, -34, 0, -34, 0, -34, 0, -34, 0, 0,
// State 37 // State 37
0, -37, -37, 0, -37, -37, 0, 0, 0, 0, 0, 0, 0, -37, -37, 0, -37, 0, -37, 0, -37, 0, 0, 0, -37, -37, 0, -37, -37, 0, 0, 0, 0, 0, 0, -37, -37, 0, -37, 0, -37, 0, -37, 0, 0,
// State 38 // State 38
0, -39, -39, 0, -39, -39, 0, 0, 0, 0, 0, 0, 0, -39, -39, 0, -39, 0, -39, 0, -39, 0, 0, 0, -39, -39, 0, -39, -39, 0, 0, 0, 0, 0, 0, -39, -39, 0, -39, 0, -39, 0, -39, 0, 0,
// State 39 // State 39
0, -25, -25, 0, -25, -25, 0, 0, 0, 0, 0, 0, 0, -25, -25, 0, -25, 0, -25, 0, -25, -25, 0, 0, -25, -25, 0, -25, -25, 0, 0, 0, 0, 0, 0, -25, -25, 0, -25, 0, -25, 0, -25, -25, 0,
// State 40 // State 40
-42, -42, -42, -42, -42, -42, 0, -42, -42, -42, -42, -42, 56, -42, -42, 0, -42, 0, -42, 0, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, 56, -42, -42, 0, -42, 0, -42, 0, -42, -42, -42,
// State 41 // State 41
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 59, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 59, 0, 0, 27, 0, 0, 0, 0,
// State 42 // State 42
-50, -50, -50, -50, -50, -50, 0, -50, -50, -50, -50, -50, -50, -50, -50, 0, -50, 0, -50, 0, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, 0, -50, 0, -50, 0, -50, -50, -50,
// State 43 // State 43
0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 44 // State 44
34, 0, 0, 0, 0, 0, 0, 35, 36, 37, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 35, 36, 37, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 45 // State 45
-13, 0, 0, 61, 0, 0, 0, -13, -13, -13, -13, -13, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, 61, 0, 0, -13, -13, -13, -13, -13, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 46 // State 46
-26, -26, -26, -26, -26, -26, 0, -26, -26, -26, -26, -26, 0, -26, -26, 0, -26, 0, -26, 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 0, -26, -26, 0, -26, 0, -26, 0, -26, -26, -26,
// State 47 // State 47
-27, -27, -27, -27, -27, -27, 0, -27, -27, -27, -27, -27, 0, -27, -27, 0, -27, 0, -27, 0, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 0, -27, -27, 0, -27, 0, -27, 0, -27, -27, -27,
// State 48 // State 48
-51, 0, 0, 0, 0, 0, 0, -51, -51, -51, -51, -51, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, -51, 0, 0, 0, 0, 0, -51, -51, -51, -51, -51, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,
// State 49 // State 49
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
// State 50 // State 50
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// State 51 // State 51
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0,
// State 52 // State 52
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0,
// State 53 // State 53
-4, -4, -4, -4, -4, -4, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, 0, -4, 0, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, 0, -4, 0, -4, -4, -4,
// State 54 // State 54
0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16,
// State 55 // State 55
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 59, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 59, 0, 0, 27, 0, 0, 0, 0,
// State 56 // State 56
-7, -7, -7, -7, -7, -7, 0, -7, -7, -7, -7, -7, -7, -7, -7, 0, -7, 0, -7, 0, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 0, -7, 0, -7, 0, -7, -7, -7,
// State 57 // State 57
-33, -33, -33, -33, -33, -33, 0, -33, -33, -33, -33, -33, -33, -33, -33, 0, -33, 0, -33, 0, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 0, -33, 0, -33, 0, -33, -33, -33,
// State 58 // State 58
-32, -32, -32, -32, -32, -32, 0, -32, -32, -32, -32, -32, -32, -32, -32, 0, -32, 0, -32, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 0, -32, 0, -32, 0, -32, -32, -32,
// State 59 // State 59
-41, -41, -41, -41, -41, -41, 0, -41, -41, -41, -41, -41, -41, -41, -41, 0, -41, 0, -41, 0, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, 0, -41, 0, -41, 0, -41, -41, -41,
// State 60 // State 60
-40, -40, -40, -40, -40, -40, 0, -40, -40, -40, -40, -40, -40, -40, -40, 0, -40, 0, -40, 0, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, 0, -40, 0, -40, 0, -40, -40, -40,
// State 61 // State 61
-17, -17, -17, -17, -17, -17, 0, -17, -17, -17, -17, -17, -17, -17, -17, 0, -17, 0, -17, 0, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 0, -17, 0, -17, 0, -17, -17, -17,
// State 62 // State 62
-18, -18, -18, -18, -18, -18, 0, -18, -18, -18, -18, -18, -18, -18, -18, 0, -18, 0, -18, 0, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 0, -18, 0, -18, 0, -18, -18, -18,
// State 63 // State 63
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0,
// State 64 // State 64
-5, -5, -5, -5, -5, -5, 0, -5, -5, -5, -5, -5, -5, -5, -5, 0, -5, 0, -5, 0, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, -5, 0, -5, 0, -5, -5, -5,
// State 65 // State 65
-8, -8, -8, -8, -8, -8, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, -8, 0, -8, 0, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, 0, -8, 0, -8, 0, -8, -8, -8,
]; ];
const __EOF_ACTION: &'static [i8] = &[ const __EOF_ACTION: &'static [i8] = &[
// State 0 // State 0
@ -451,7 +451,6 @@ mod __parse__Pipeline {
r###"")""###, r###"")""###,
r###""-""###, r###""-""###,
r###""--""###, r###""--""###,
r###"".""###,
r###""<""###, r###""<""###,
r###""<=""###, r###""<=""###,
r###""==""###, r###""==""###,
@ -469,7 +468,7 @@ mod __parse__Pipeline {
r###""|""###, r###""|""###,
r###""}""###, r###""}""###,
]; ];
__ACTION[(__state * 23)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| { __ACTION[(__state * 22)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| {
if state == 0 { if state == 0 {
None None
} else { } else {
@ -513,12 +512,12 @@ mod __parse__Pipeline {
#[inline] #[inline]
fn action(&self, state: i8, integer: usize) -> i8 { fn action(&self, state: i8, integer: usize) -> i8 {
__ACTION[(state as usize) * 23 + integer] __ACTION[(state as usize) * 22 + integer]
} }
#[inline] #[inline]
fn error_action(&self, state: i8) -> i8 { fn error_action(&self, state: i8) -> i8 {
__ACTION[(state as usize) * 23 + (23 - 1)] __ACTION[(state as usize) * 22 + (22 - 1)]
} }
#[inline] #[inline]
@ -586,23 +585,22 @@ mod __parse__Pipeline {
SpannedToken { token: Token::CloseParen, .. } if true => Some(3), SpannedToken { token: Token::CloseParen, .. } if true => Some(3),
SpannedToken { token: Token::Dash, .. } if true => Some(4), SpannedToken { token: Token::Dash, .. } if true => Some(4),
SpannedToken { token: Token::DashDash, .. } if true => Some(5), SpannedToken { token: Token::DashDash, .. } if true => Some(5),
SpannedToken { token: Token::Dot, .. } if true => Some(6), SpannedToken { token: Token::OpLt, .. } if true => Some(6),
SpannedToken { token: Token::OpLt, .. } if true => Some(7), SpannedToken { token: Token::OpLte, .. } if true => Some(7),
SpannedToken { token: Token::OpLte, .. } if true => Some(8), SpannedToken { token: Token::OpEq, .. } if true => Some(8),
SpannedToken { token: Token::OpEq, .. } if true => Some(9), SpannedToken { token: Token::OpGt, .. } if true => Some(9),
SpannedToken { token: Token::OpGt, .. } if true => Some(10), SpannedToken { token: Token::OpGte, .. } if true => Some(10),
SpannedToken { token: Token::OpGte, .. } if true => Some(11), SpannedToken { token: Token::PathDot, .. } if true => Some(11),
SpannedToken { token: Token::PathDot, .. } if true => Some(12), SpannedToken { token: Token::Bare, .. } if true => Some(12),
SpannedToken { token: Token::Bare, .. } if true => Some(13), SpannedToken { token: Token::DQString, .. } if true => Some(13),
SpannedToken { token: Token::DQString, .. } if true => Some(14), SpannedToken { token: Token::Member, .. } if true => Some(14),
SpannedToken { token: Token::Member, .. } if true => Some(15), SpannedToken { token: Token::Num, .. } if true => Some(15),
SpannedToken { token: Token::Num, .. } if true => Some(16), SpannedToken { token: Token::Size, .. } if true => Some(16),
SpannedToken { token: Token::Size, .. } if true => Some(17), SpannedToken { token: Token::SQString, .. } if true => Some(17),
SpannedToken { token: Token::SQString, .. } if true => Some(18), SpannedToken { token: Token::Variable, .. } if true => Some(18),
SpannedToken { token: Token::Variable, .. } if true => Some(19), SpannedToken { token: Token::OpenBrace, .. } if true => Some(19),
SpannedToken { token: Token::OpenBrace, .. } if true => Some(20), SpannedToken { token: Token::Pipe, .. } if true => Some(20),
SpannedToken { token: Token::Pipe, .. } if true => Some(21), SpannedToken { token: Token::CloseBrace, .. } if true => Some(21),
SpannedToken { token: Token::CloseBrace, .. } if true => Some(22),
_ => None, _ => None,
} }
} }
@ -640,70 +638,66 @@ mod __parse__Pipeline {
_ => unreachable!(), _ => unreachable!(),
}, },
6 => match __token { 6 => match __token {
__tok @ SpannedToken { token: Token::Dot, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(),
},
7 => match __token {
__tok @ SpannedToken { token: Token::OpLt, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::OpLt, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
8 => match __token { 7 => match __token {
__tok @ SpannedToken { token: Token::OpLte, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::OpLte, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
9 => match __token { 8 => match __token {
__tok @ SpannedToken { token: Token::OpEq, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::OpEq, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
10 => match __token { 9 => match __token {
__tok @ SpannedToken { token: Token::OpGt, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::OpGt, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
11 => match __token { 10 => match __token {
__tok @ SpannedToken { token: Token::OpGte, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::OpGte, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
12 => match __token { 11 => match __token {
__tok @ SpannedToken { token: Token::PathDot, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::PathDot, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
13 => match __token { 12 => match __token {
__tok @ SpannedToken { token: Token::Bare, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::Bare, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
14 => match __token { 13 => match __token {
__tok @ SpannedToken { token: Token::DQString, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::DQString, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
15 => match __token { 14 => match __token {
__tok @ SpannedToken { token: Token::Member, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::Member, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
16 => match __token { 15 => match __token {
__tok @ SpannedToken { token: Token::Num, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::Num, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
17 => match __token { 16 => match __token {
__tok @ SpannedToken { token: Token::Size, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::Size, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
18 => match __token { 17 => match __token {
__tok @ SpannedToken { token: Token::SQString, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::SQString, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
19 => match __token { 18 => match __token {
__tok @ SpannedToken { token: Token::Variable, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::Variable, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
20 => match __token { 19 => match __token {
__tok @ SpannedToken { token: Token::OpenBrace, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::OpenBrace, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
21 => match __token { 20 => match __token {
__tok @ SpannedToken { token: Token::Pipe, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::Pipe, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },
22 => match __token { 21 => match __token {
__tok @ SpannedToken { token: Token::CloseBrace, .. } => __Symbol::Variant0((__tok)), __tok @ SpannedToken { token: Token::CloseBrace, .. } => __Symbol::Variant0((__tok)),
_ => unreachable!(), _ => unreachable!(),
}, },

View File

@ -116,7 +116,7 @@ fn token_style(
(State::Var, Variable) => (Color::Yellow.bold(), State::None), (State::Var, Variable) => (Color::Yellow.bold(), State::None),
(State::Bare, Dot) => (Color::Green.normal(), State::Bare), (State::Bare, PathDot) => (Color::Green.normal(), State::Bare),
(State::Bare, Member) => (Color::Green.normal(), State::Bare), (State::Bare, Member) => (Color::Green.normal(), State::Bare),
(_, Dash) | (_, DashDash) => (Color::Black.bold(), State::Flag), (_, Dash) | (_, DashDash) => (Color::Black.bold(), State::Flag),