1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-FileCopyrightText: Provenant contributors
// SPDX-License-Identifier: Apache-2.0
//! Type definitions for the copyright grammar: the matcher and rule types used
//! to express grammar rules as Rust data. Rules are applied bottom-up to a
//! sequence of POS-tagged tokens; each rule matches a pattern of tags/labels
//! and replaces the matched span with a new tree node.
//!
//! The grammar rules themselves — ported from the Python `GRAMMAR` string in
//! `reference/scancode-toolkit/src/cluecode/copyrights.py` — live in
//! `rules.rs`, which carries the corresponding upstream attribution.
use crate;
/// A matcher for a single position in a grammar rule pattern.
pub
/// A grammar rule: matches a pattern and produces a tree node with the given label.
pub