Skip to content

Commit

Permalink
hide intermediate public parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
vthriller committed Jan 25, 2018
1 parent 77abe04 commit bb6913f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ left_op!(and_unless, comparison, alt!(

left_op!(or_op, and_unless, with_modifier!("or", Op::Or));

named!(pub expression <CompleteByteSlice, Node>, call!(or_op));
// XXX nom does not allow pub(crate) here
named_attr!(#[doc(hidden)], pub expression <CompleteByteSlice, Node>, call!(or_op));

#[allow(unused_imports)]
#[cfg(test)]
Expand Down
9 changes: 2 additions & 7 deletions src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,8 @@ named!(range_literal <CompleteByteSlice, usize>, do_parse!(
(num * suffix)
));

named_attr!(
/**
Parses vector expression into the [`Vector`](struct.Vector.html).
This parser operates on byte sequence instead of `&str` because of the fact that PromQL, like Go, allows raw byte sequences to be included in the string literals (e.g. `{omg='∞'}` is equivalent to both `{omg='\u221e'}` and `{omg='\xe2\x88\x9e'}`).
*/,
pub vector <CompleteByteSlice, Vector>, ws!(do_parse!(
// XXX nom does not allow pub(crate) here
named_attr!(#[doc(hidden)], pub vector <CompleteByteSlice, Vector>, ws!(do_parse!(
labels: instant_vec >>
range: opt!(
delimited!(char!('['), range_literal, char!(']'))
Expand Down

0 comments on commit bb6913f

Please sign in to comment.