// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
-//! PSPP syntax scanning.
+//! # PSPP tokenization
//!
//! PSPP divides traditional "lexical analysis" or "tokenization" into two
//! phases: a lower-level phase called "segmentation" and a higher-level phase
-//! called "scanning". [segment] implements the segmentation phase and
-//! this module the scanning phase.
+//! called "scanning". The [segment] module implements the segmentation phase
+//! and the [scan] module the scanning phase.
//!
//! Scanning accepts as input a stream of segments, which are UTF-8 strings each
//! labeled with a segment type. It outputs a stream of "scan tokens", which
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
-//! PSPP lexical analysis.
+//! # High-level lexical analysis
//!
-//! PSPP divides traditional "lexical analysis" or "tokenization" into two
-//! phases: a lower-level phase called "segmentation" and a higher-level phase
-//! called "scanning". [mod segment] implements the segmentation phase and [mod
-//! scan] the scanning phase.
+//! This module implements higher-level lexical analysis using the segments
+//! output by the lower-level [segmentation phase](super::segment).
//!
-//! Scanning accepts as input a stream of segments, which are UTF-8 strings each
-//! labeled with a segment type. It outputs a stream of "scan tokens", which
-//! are the same as the tokens used by the PSPP parser with a few additional
-//! types.
+//! Scanning accepts as input a stream of segments, which are UTF-8 strings
+//! labeled with a [segment type](super::segment::Segment). It outputs a stream
+//! of [ScanToken]s, which are either the [Token] used by the PSPP parser or an
+//! error.
use crate::identifier::{Identifier, ReservedWord};
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
-//! Syntax segmentation.
+//! # Low-level lexical analysis
//!
//! PSPP divides traditional "lexical analysis" or "tokenization" into two
//! phases: a lower-level phase called "segmentation" and a higher-level phase
-//! called "scanning". This module implements the segmentation phase.
-//! [`super::scan`] contains declarations for the scanning phase.
+//! called "scanning". This module implements the segmentation phase; the
+//! [scan](super::scan) module implements the higher-level scanning phase.
//!
//! Segmentation accepts a stream of UTF-8 bytes as input. It outputs a label
//! (a segment type) for each byte or contiguous sequence of bytes in the input.