Skip to main content

tsz_common/
lib.rs

1//! Common types and utilities for the tsz TypeScript compiler.
2//!
3//! This crate provides foundational types used across all tsz crates:
4//! - String interning (`Atom`, `Interner`, `ShardedInterner`)
5//! - Common enums (`ModuleKind`, `NewLineKind`, `ScriptTarget`)
6//! - Source spans (`Span`, `Spanned`, `SpanBuilder`, `ByteSpan`)
7//! - Compiler limits and thresholds
8//! - Position/Range types for source locations
9//! - Source map generation
10//! - Comment parsing utilities
11
12// String interning for identifier deduplication
13pub mod interner;
14pub use interner::{Atom, Interner, ShardedInterner};
15
16// Common types - Shared constants to break circular dependencies
17pub mod common;
18pub use common::{ModuleKind, NewLineKind, ScriptTarget};
19
20// Span - Source location tracking (byte offsets)
21pub mod span;
22pub use span::{ByteSpan, Span, SpanBuilder, Spanned};
23
24// Centralized limits and thresholds
25pub mod limits;
26
27// Position/Range types for line/column source locations
28pub mod position;
29pub use position::{LineMap, Location, Position, Range, SourceLocation};
30
31// Source Map generation
32pub mod source_map;
33
34// Comment parsing utilities
35pub mod comments;
36
37// Diagnostic codes and message templates (shared by parser and checker)
38pub mod diagnostics;
39
40// Compiler options for type checking (shared by solver and checker)
41pub mod checker_options;
42pub use checker_options::CheckerOptions;
43pub mod numeric;