Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing values #3

Open
8 of 9 tasks
fdncred opened this issue Sep 20, 2022 · 4 comments
Open
8 of 9 tasks

missing values #3

fdncred opened this issue Sep 20, 2022 · 4 comments

Comments

@fdncred
Copy link
Contributor

fdncred commented Sep 20, 2022

Just documenting missing values from nushell's enum Value - not sure how to add these exactly

  • bool
  • date
  • range
  • list
  • nothing
  • error
  • binary
  • cellpath
  • customvalue
@sophiajt
Copy link
Contributor

I don't think error has syntax. For nothing, do you mean $nothing?

@fdncred
Copy link
Contributor Author

fdncred commented Sep 20, 2022

I don't think error has syntax. For nothing, do you mean $nothing?

These are all Value::Blah in the enum. So, there is Value::Error and Value::Nothing. I was just going from this enum and looking for a one to one match in the pest file.

pub enum Value {
    Bool {
        val: bool,
        span: Span,
    },
    Int {
        val: i64,
        span: Span,
    },
    Float {
        val: f64,
        span: Span,
    },
    Filesize {
        val: i64,
        span: Span,
    },
    Duration {
        val: i64,
        span: Span,
    },
    Date {
        val: DateTime<FixedOffset>,
        span: Span,
    },
    Range {
        val: Box<Range>,
        span: Span,
    },
    String {
        val: String,
        span: Span,
    },
    Record {
        cols: Vec<String>,
        vals: Vec<Value>,
        span: Span,
    },
    List {
        vals: Vec<Value>,
        span: Span,
    },
    Block {
        val: BlockId,
        captures: HashMap<VarId, Value>,
        span: Span,
    },
    Nothing {
        span: Span,
    },
    Error {
        error: ShellError,
    },
    Binary {
        val: Vec<u8>,
        span: Span,
    },
    CellPath {
        val: CellPath,
        span: Span,
    },
    CustomValue {
        val: Box<dyn CustomValue>,
        span: Span,
    },
}

@sophiajt
Copy link
Contributor

Yeah I'm guessing that's just $nothing so I'll check that one off too

@sophiajt
Copy link
Contributor

Not sure what we should do with custom value... I think maybe we don't do anything in the grammar since it would mean having to update the grammar for any thirdparty plugin that adds a new data type. We probably want a kind of catch-all syntax that third party plugins could then parse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants