yerba 0.9.2-aarch64-linux-gnu → 0.10.0-aarch64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -17
  3. data/exe/aarch64-linux-gnu/yerba +0 -0
  4. data/ext/yerba/include/yerba.h +56 -34
  5. data/ext/yerba/yerba.c +268 -186
  6. data/lib/yerba/3.2/yerba.so +0 -0
  7. data/lib/yerba/3.3/yerba.so +0 -0
  8. data/lib/yerba/3.4/yerba.so +0 -0
  9. data/lib/yerba/4.0/yerba.so +0 -0
  10. data/lib/yerba/collection.rb +4 -4
  11. data/lib/yerba/document.rb +134 -0
  12. data/lib/yerba/formatting.rb +1 -0
  13. data/lib/yerba/location.rb +8 -1
  14. data/lib/yerba/map.rb +16 -6
  15. data/lib/yerba/node.rb +41 -0
  16. data/lib/yerba/query_result.rb +33 -10
  17. data/lib/yerba/scalar.rb +29 -0
  18. data/lib/yerba/selector.rb +3 -1
  19. data/lib/yerba/sequence.rb +38 -33
  20. data/lib/yerba/version.rb +1 -1
  21. data/rust/Cargo.lock +1 -1
  22. data/rust/Cargo.toml +1 -1
  23. data/rust/src/commands/get.rs +12 -12
  24. data/rust/src/commands/init.rs +8 -8
  25. data/rust/src/commands/insert.rs +4 -18
  26. data/rust/src/commands/location.rs +2 -0
  27. data/rust/src/commands/mod.rs +34 -6
  28. data/rust/src/commands/move_item.rs +1 -1
  29. data/rust/src/commands/move_key.rs +8 -8
  30. data/rust/src/commands/rename.rs +1 -1
  31. data/rust/src/commands/selectors.rs +1 -1
  32. data/rust/src/commands/set.rs +14 -6
  33. data/rust/src/document/condition.rs +25 -25
  34. data/rust/src/document/delete.rs +57 -43
  35. data/rust/src/document/get.rs +91 -82
  36. data/rust/src/document/insert.rs +77 -77
  37. data/rust/src/document/mod.rs +138 -64
  38. data/rust/src/document/nodes.rs +162 -0
  39. data/rust/src/document/schema.rs +8 -8
  40. data/rust/src/document/set.rs +49 -26
  41. data/rust/src/document/sort.rs +54 -54
  42. data/rust/src/document/style.rs +50 -49
  43. data/rust/src/document/unique.rs +5 -5
  44. data/rust/src/error.rs +8 -4
  45. data/rust/src/ffi.rs +218 -106
  46. data/rust/src/json.rs +62 -2
  47. data/rust/src/lib.rs +2 -1
  48. data/rust/src/main.rs +2 -1
  49. data/rust/src/selector.rs +48 -7
  50. data/rust/src/syntax.rs +449 -56
  51. data/rust/src/validation.rs +5 -3
  52. data/rust/src/yerbafile.rs +124 -76
  53. metadata +3 -2
@@ -11,12 +11,12 @@ pub struct DuplicateInfo {
11
11
  }
12
12
 
13
13
  impl Document {
14
- pub fn unique(&mut self, dot_path: &str, by: &str, remove: bool) -> Result<Vec<DuplicateInfo>, YerbaError> {
15
- self.unique_with_options(dot_path, by, remove, false)
14
+ pub fn unique(&mut self, selector: &str, by: &str, remove: bool) -> Result<Vec<DuplicateInfo>, YerbaError> {
15
+ self.unique_with_options(selector, by, remove, false)
16
16
  }
17
17
 
18
- pub fn unique_with_options(&mut self, dot_path: &str, by: &str, remove: bool, allow_blank_duplicates: bool) -> Result<Vec<DuplicateInfo>, YerbaError> {
19
- let current_node = self.navigate(dot_path)?;
18
+ pub fn unique_with_options(&mut self, selector: &str, by: &str, remove: bool, allow_blank_duplicates: bool) -> Result<Vec<DuplicateInfo>, YerbaError> {
19
+ let current_node = self.navigate(selector)?;
20
20
  let source = self.source_text();
21
21
 
22
22
  let sequence = match find_block_sequence(&current_node) {
@@ -76,7 +76,7 @@ impl Document {
76
76
 
77
77
  if remove && !duplicate_indices.is_empty() {
78
78
  for &index in duplicate_indices.iter().rev() {
79
- self.remove_at(dot_path, index)?;
79
+ self.remove_at(selector, index)?;
80
80
  }
81
81
  }
82
82
 
data/rust/src/error.rs CHANGED
@@ -27,13 +27,13 @@ impl std::fmt::Display for YerbaError {
27
27
  YerbaError::ParseError(msg) => write!(f, "parse error: {}", msg),
28
28
  YerbaError::IoError(err) => write!(f, "io error: {}", err),
29
29
  YerbaError::SelectorNotFound(selector) => write!(f, "selector not found: {}", selector),
30
- YerbaError::NotASequence(path) => write!(f, "not a sequence: {}", path),
30
+ YerbaError::NotASequence(selector) => write!(f, "not a sequence: {}", selector),
31
31
 
32
- YerbaError::FlowCollectionNotWritable(path) => {
32
+ YerbaError::FlowCollectionNotWritable(selector) => {
33
33
  write!(
34
34
  f,
35
35
  "cannot write to \"{}\": flow collections are not writable yet. Convert it to block style first, with `collection_style` or `yerba collection-style`",
36
- path
36
+ selector
37
37
  )
38
38
  }
39
39
 
@@ -170,7 +170,11 @@ impl GitHubAnnotations for YerbaError {
170
170
  level: "error ",
171
171
  file: file.to_string(),
172
172
  line: Some(control.line),
173
- message: format!("control character U+{:04X} at column {}", control.character as u32, control.column),
173
+ message: format!(
174
+ "control character U+{:04X} at column {}",
175
+ control.character as u32,
176
+ control.character_column + 1
177
+ ),
174
178
  })
175
179
  .collect(),
176
180