[package]
name = "sas-lexer"
description = "Ultra fast \"correct\" static context-aware parsing SAS code lexer."
authors = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }
readme = { workspace = true }
license = { workspace = true }
keywords = { workspace = true }
categories = { workspace = true }
exclude = ["benches/*", "src/**/tests/*"]

[lib]

[dependencies]
phf = { workspace = true }
sas-lexer-macro = { workspace = true }
serde = { workspace = true, features = ["derive"], optional = true }
serde_repr = { version = "0.1.19", optional = true }
strum = { workspace = true }
unicode-ident = "1.0.12"
lexical = { version = "7.0.2", default-features = false, features = [
    "std",
    "power-of-two",
    "parse-floats",
    "parse-integers",
    "format",
] }
bit-vec = "0.8.0"
encoding = "0.2.33"

[dev-dependencies]
criterion = { workspace = true, features = ["html_reports"] }
insta = { workspace = true }
rstest = { workspace = true }
zip = { workspace = true }
walkdir = { workspace = true }

[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
pprof = { workspace = true, features = ["flamegraph", "criterion"] }

[build-dependencies]
rustc_version = { workspace = true }

[features]
macro_sep = []
opti_stats = []
serde = ["dep:serde", "dep:serde_repr"]

[lints]
workspace = true

[[bench]]
name = "lexer"
harness = false

[package.metadata.release]
tag-prefix = "rust-"

pre-release-replacements = [
    # Remove unused subsections in unreleased section
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "### Added\n-\\s*\n", replace = "", min = 0, max = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "### Changed\n-\\s*\n", replace = "", min = 0, max = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "### Deprecated\n-\\s*\n", replace = "", min = 0, max = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "### Removed\n-\\s*\n", replace = "", min = 0, max = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "### Fixed\n-\\s*\n", replace = "", min = 0, max = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "### Security\n-\\s*\n", replace = "", min = 0, max = 1 },
    # Replace placeholders
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "Unreleased", replace = "{{version}}", exactly = 2 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}", exactly = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "ReleaseDate", replace = "{{date}}", exactly = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "<!-- next-url -->", replace = "<!-- next-url -->\n[Unreleased]: https://github.com/mishamsk/sas-lexer/compare/{{tag_name}}...HEAD", exactly = 1 },
    { file = "../../CHANGELOG-RUST.md", prerelease = true, search = "<!-- next-header -->", replace = """
<!-- next-header -->

## [Unreleased] - ReleaseDate

### Added
-

### Changed
-

### Deprecated
-

### Removed
-

### Fixed
-

### Security
-""", exactly = 1 },
]