Revert "Migrate most uses of the Span concept to Tag"

This commit is contained in:
Jonathan Turner
2019-09-11 19:53:05 +12:00
committed by GitHub
parent f05c7d6792
commit bee7c5639c
97 changed files with 1255 additions and 1174 deletions

View File

@ -1,6 +1,6 @@
use nu::{
serve_plugin, CallInfo, Plugin, Primitive, ReturnSuccess, ReturnValue, ShellError, Signature,
Tagged, TaggedItem, Value,
Tag, Tagged, Value,
};
struct Sum {
@ -18,10 +18,11 @@ impl Sum {
match &self.total {
Some(Tagged {
item: Value::Primitive(Primitive::Int(j)),
tag,
tag: Tag { span, .. },
}) => {
//TODO: handle overflow
self.total = Some(Value::int(i + j).tagged(*tag));
self.total =
Some(Tagged::from_simple_spanned_item(Value::int(i + j), span));
Ok(())
}
None => {
@ -37,10 +38,11 @@ impl Sum {
match self.total {
Some(Tagged {
item: Value::Primitive(Primitive::Bytes(j)),
tag,
tag: Tag { span, .. },
}) => {
//TODO: handle overflow
self.total = Some(Value::bytes(b + j).tagged(tag));
self.total =
Some(Tagged::from_simple_spanned_item(Value::bytes(b + j), span));
Ok(())
}
None => {