# Alto Code Slicer

Alto Code Slicer extracts immutable ranges from source code while preserving
the original bytes, language, source name, and line numbers. It selects by
lines, literal boundaries, or supported language structures and leaves
rendering to the consuming application.

```php
use Alto\Code\Slicer\CodeSource;

$slice = CodeSource::fromString("first\nsecond")->lines(2, 2);
echo $slice->content();
```

The result is `second`, still associated with original source line 2.

## Documentation

- [Installation](https://altophp.com/code-slicer/installation.md): install the package and verify a first selection.
- [Getting started](https://altophp.com/code-slicer/getting-started.md): extract a complete PHP method with its original line number.
- [Selectors](https://altophp.com/code-slicer/selectors.md): create sources, chain selections, inspect ranges, and handle failures.
- [Languages](https://altophp.com/code-slicer/languages.md): choose text or structural selectors for each supported source.

## Boundaries

A `CodeSource` owns the complete input. A `CodeSlice` identifies a half-open
byte range within that source, and every selector returns a new narrower slice.
Code Slicer does not highlight, render, rewrite, compile, or execute the
selected source.
