style: wrap comments
This commit is contained in:
parent
b35efa8f33
commit
5825e24d56
13 changed files with 246 additions and 220 deletions
|
|
@ -850,10 +850,11 @@ fn test_node_numeric_symbols_respect_simple_aliases() {
|
|||
parser.set_language(&get_language("python")).unwrap();
|
||||
|
||||
// Example 1:
|
||||
// Python argument lists can contain "splat" arguments, which are not allowed within
|
||||
// other expressions. This includes `parenthesized_list_splat` nodes like `(*b)`. These
|
||||
// `parenthesized_list_splat` nodes are aliased as `parenthesized_expression`. Their numeric
|
||||
// `symbol`, aka `kind_id` should match that of a normal `parenthesized_expression`.
|
||||
// Python argument lists can contain "splat" arguments, which are not allowed
|
||||
// within other expressions. This includes `parenthesized_list_splat` nodes
|
||||
// like `(*b)`. These `parenthesized_list_splat` nodes are aliased as
|
||||
// `parenthesized_expression`. Their numeric `symbol`, aka `kind_id` should
|
||||
// match that of a normal `parenthesized_expression`.
|
||||
let tree = parser.parse("(a((*b)))", None).unwrap();
|
||||
let root = tree.root_node();
|
||||
assert_eq!(
|
||||
|
|
@ -875,9 +876,9 @@ fn test_node_numeric_symbols_respect_simple_aliases() {
|
|||
assert_eq!(inner_expr_node.kind_id(), outer_expr_node.kind_id());
|
||||
|
||||
// Example 2:
|
||||
// Ruby handles the unary (negative) and binary (minus) `-` operators using two different
|
||||
// tokens. One or more of these is an external token that's aliased as `-`. Their numeric
|
||||
// kind ids should match.
|
||||
// Ruby handles the unary (negative) and binary (minus) `-` operators using two
|
||||
// different tokens. One or more of these is an external token that's
|
||||
// aliased as `-`. Their numeric kind ids should match.
|
||||
parser.set_language(&get_language("ruby")).unwrap();
|
||||
let tree = parser.parse("-a - b", None).unwrap();
|
||||
let root = tree.root_node();
|
||||
|
|
|
|||
|
|
@ -891,12 +891,12 @@ fn test_query_matches_with_immediate_siblings() {
|
|||
let language = get_language("python");
|
||||
|
||||
// The immediate child operator '.' can be used in three similar ways:
|
||||
// 1. Before the first child node in a pattern, it means that there cannot be any
|
||||
// named siblings before that child node.
|
||||
// 1. Before the first child node in a pattern, it means that there cannot be any named
|
||||
// siblings before that child node.
|
||||
// 2. After the last child node in a pattern, it means that there cannot be any named
|
||||
// sibling after that child node.
|
||||
// 2. Between two child nodes in a pattern, it specifies that there cannot be any
|
||||
// named siblings between those two child snodes.
|
||||
// 2. Between two child nodes in a pattern, it specifies that there cannot be any named
|
||||
// siblings between those two child snodes.
|
||||
let query = Query::new(
|
||||
&language,
|
||||
"
|
||||
|
|
@ -1425,7 +1425,8 @@ fn test_query_matches_with_nested_optional_nodes() {
|
|||
allocations::record(|| {
|
||||
let language = get_language("javascript");
|
||||
|
||||
// A function call, optionally containing a function call, which optionally contains a number
|
||||
// A function call, optionally containing a function call, which optionally contains a
|
||||
// number
|
||||
let query = Query::new(
|
||||
&language,
|
||||
"
|
||||
|
|
@ -3269,8 +3270,8 @@ fn test_query_captures_with_too_many_nested_results() {
|
|||
// appearance.
|
||||
// 2. This pattern captures the root `call_expression`.
|
||||
// 3. This pattern's result also depends on the final child (the template string).
|
||||
// 4. In between the `call_expression` and the possible `template_string`, there can
|
||||
// be an arbitrarily deep subtree.
|
||||
// 4. In between the `call_expression` and the possible `template_string`, there can be an
|
||||
// arbitrarily deep subtree.
|
||||
//
|
||||
// This means that, if any patterns match *after* the initial `call_expression` is
|
||||
// captured, but before the final `template_string` is found, those matches must
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue