mirror of
https://github.com/sharkdp/bat.git
synced 2024-12-27 00:38:52 +01:00
Merge branch 'master' into improved-benchmark
This commit is contained in:
commit
1b549ecc66
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -28,11 +28,11 @@ If you're on Windows:
|
||||
**Describe the bug you encountered:**
|
||||
...
|
||||
|
||||
**Describe what you expected to happen?**
|
||||
**What did you expect to happen instead?**
|
||||
...
|
||||
|
||||
**How did you install `bat`?**
|
||||
apt-get, homebrew, GitHub release, etc.
|
||||
<!-- apt-get, homebrew, GitHub release, etc. -->
|
||||
|
||||
---
|
||||
|
||||
|
26
.github/workflows/CICD.yml
vendored
26
.github/workflows/CICD.yml
vendored
@ -22,6 +22,12 @@ jobs:
|
||||
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
|
||||
default: true
|
||||
profile: minimal # minimal component installation (ie, no documentation)
|
||||
components: clippy
|
||||
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all-targets --all-features -- --allow clippy::style
|
||||
- name: Test
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
@ -58,6 +64,11 @@ jobs:
|
||||
with:
|
||||
command: test
|
||||
args: --release
|
||||
- name: Run ignored-by-default unit tests with new syntaxes and themes
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --release -- --ignored
|
||||
- name: Syntax highlighting regression test
|
||||
run: tests/syntax-tests/regression_test.sh
|
||||
- name: List of languages
|
||||
@ -147,6 +158,8 @@ jobs:
|
||||
echo ::set-output name=PKG_NAME::${PKG_NAME}
|
||||
# deployable tag? (ie, leading "vM" or "M"; M == version number)
|
||||
unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi
|
||||
# unset deploy on ubuntu-18.04 x64 - we will deploy the tarball/deb built on ubuntu-16.04 x64
|
||||
if [ "${{ matrix.job.os }}" = "ubuntu-18.04" ] && [ "${{ matrix.job.target }}" = "x86_64-unknown-linux-gnu" ]; then unset DEPLOY; fi
|
||||
echo set-output name=DEPLOY::${DEPLOY:-<empty>/false}
|
||||
echo ::set-output name=DEPLOY::${DEPLOY}
|
||||
# DPKG architecture?
|
||||
@ -302,18 +315,6 @@ jobs:
|
||||
install -Dm755 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}"
|
||||
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}" ; fi
|
||||
|
||||
# Work out shared library dependencies
|
||||
# dpkg-shlibdeps requires debian/control file. Dummy it and clean up
|
||||
mkdir "./debian"
|
||||
touch "./debian/control"
|
||||
case ${{ matrix.job.target }} in
|
||||
aarch64-*-linux-*) DEPENDS="$(dpkg-shlibdeps -l/usr/aarch64-linux-gnu/lib -O "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}" 2> /dev/null | sed 's/^shlibs:Depends=//')" ;;
|
||||
arm-*-linux-*hf) DEPENDS="$(dpkg-shlibdeps -l/usr/arm-linux-gnueabihf/lib -O "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}" 2> /dev/null | sed 's/^shlibs:Depends=//')" ;;
|
||||
i686-*-linux-*) DEPENDS="$(dpkg-shlibdeps -O "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}" 2> /dev/null | sed 's/^shlibs:Depends=//')" ;;
|
||||
x86_64-*-linux-*) DEPENDS="$(dpkg-shlibdeps -O "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}" 2> /dev/null | sed 's/^shlibs:Depends=//')" ;;
|
||||
esac;
|
||||
rm -rf "./debian"
|
||||
|
||||
# Man page
|
||||
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/manual/bat.1 "${DPKG_DIR}/usr/share/man/man1/${{ env.PROJECT_NAME }}.1"
|
||||
gzip -n --best "${DPKG_DIR}/usr/share/man/man1/${{ env.PROJECT_NAME }}.1"
|
||||
@ -380,7 +381,6 @@ jobs:
|
||||
Maintainer: ${{ env.PROJECT_MAINTAINER }}
|
||||
Homepage: ${{ env.PROJECT_HOMEPAGE }}
|
||||
Architecture: ${{ steps.vars.outputs.DPKG_ARCH }}
|
||||
Depends: $DEPENDS
|
||||
Provides: ${{ env.PROJECT_NAME }}
|
||||
Conflicts: ${{ steps.vars.outputs.DPKG_CONFLICTS }}
|
||||
Description: cat(1) clone with wings.
|
||||
|
22
.gitmodules
vendored
22
.gitmodules
vendored
@ -185,9 +185,6 @@
|
||||
[submodule "assets/syntaxes/02_Extra/AsciiDoc"]
|
||||
path = assets/syntaxes/02_Extra/AsciiDoc
|
||||
url = https://github.com/asciidoctor/sublimetext-asciidoc.git
|
||||
[submodule "assets/themes/gruvbox"]
|
||||
path = assets/themes/gruvbox
|
||||
url = https://github.com/peaceant/gruvbox.git
|
||||
[submodule "assets/syntaxes/02_Extra/GLSL"]
|
||||
path = assets/syntaxes/02_Extra/GLSL
|
||||
url = https://github.com/euler0/sublime-glsl
|
||||
@ -197,3 +194,22 @@
|
||||
[submodule "assets/syntaxes/02_Extra/Apache"]
|
||||
path = assets/syntaxes/02_Extra/Apache
|
||||
url = https://github.com/colinta/ApacheConf.tmLanguage
|
||||
[submodule "assets/syntaxes/02_Extra/Ninja"]
|
||||
path = assets/syntaxes/02_Extra/Ninja
|
||||
url = https://github.com/pope/SublimeNinja.git
|
||||
[submodule "assets/syntaxes/02_Extra/Svelte"]
|
||||
path = assets/syntaxes/02_Extra/Svelte
|
||||
url = https://github.com/corneliusio/svelte-sublime
|
||||
[submodule "assets/themes/Coldark"]
|
||||
path = assets/themes/Coldark
|
||||
url = https://github.com/ArmandPhilippot/coldark-bat.git
|
||||
[submodule "assets/themes/gruvbox"]
|
||||
path = assets/themes/gruvbox
|
||||
url = https://github.com/subnut/gruvbox-tmTheme.git
|
||||
branch = bat-source
|
||||
[submodule "assets/syntaxes/02_Extra/Lean"]
|
||||
path = assets/syntaxes/02_Extra/Lean
|
||||
url = https://github.com/leanprover/vscode-lean.git
|
||||
[submodule "assets/syntaxes/02_Extra/Zig"]
|
||||
path = assets/syntaxes/02_Extra/Zig
|
||||
url = https://github.com/ziglang/sublime-zig-language.git
|
||||
|
56
CHANGELOG.md
56
CHANGELOG.md
@ -1,21 +1,75 @@
|
||||
# unreleased
|
||||
|
||||
- Add Note to refer to see detailed help with --help (and vice versa with -h). see #1215 (@henil)
|
||||
|
||||
## Features
|
||||
- Use a pager when `bat --list-languages` is called, see #1394 (@stku1985)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- If the last line doesn't end with a newline character, don't add it if `--style=plain`, see #1438 (@Enselic)
|
||||
- Only print themes hint in interactive mode (`bat --list-themes`), see #1439 (@rsteube)
|
||||
- Make ./tests/syntax-tests/regression_test.sh work on recent versions of macOS, see #1443 (@Enselic)
|
||||
- VimL syntax highlighting fix, see #1450 (@esensar)
|
||||
- Print an 'Invalid syntax theme settings' error message if a custom theme is broken, see #614 (@Enselic)
|
||||
|
||||
## Other
|
||||
|
||||
- Performance improvements, see #1421 (@LovecraftianHorror)
|
||||
|
||||
## Syntaxes
|
||||
|
||||
- Added Zig syntax, see #1470 (@paulsmith)
|
||||
- Added Lean syntax, see #1446 (@Julian)
|
||||
- Added `.resource` extension for Robot Framework files, see #1386
|
||||
|
||||
## New themes
|
||||
|
||||
- `ansi` replaces `ansi-dark` and `ansi-light`, see #1104 and #1412 (@mk12)
|
||||
- The Gruvbox theme has been updated, see #1291 (@j0hnmeow). **Breaking change:** users that were previously usuing `gruvbox` or `gruvbox-white` should update and use `gruvbox-dark`/`gruvbox-light` instead.
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
## Packaging
|
||||
|
||||
- `bat` is now available on snapstore with package name called `batcat`, see #1401 (@purveshpatel511)
|
||||
|
||||
|
||||
# v0.17.1
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Running `bat` without arguments fails ("output file is also an input"), see #1396
|
||||
|
||||
|
||||
# v0.17.0
|
||||
|
||||
## Features
|
||||
|
||||
- Added a new `--style` value, `rule`, which adds a simple horizontal ruled line between files, see #1276 (@tommilligan)
|
||||
- Pass `-S` ("chop long lines") to `less` if `--wrap=never` is set in `bat`, see #1255 (@gahag)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Detect infinite loop when input and output are the same, see #1193 and #1197 (@niklasmohrin)
|
||||
- Throw an error when `bat` is being used as `pager`, see #1343 (@adrian-rivera)
|
||||
- Bash syntax highlighting not selected for `*.ebuild` and `*.eclass` files, see #1292 (@sharkdp)
|
||||
- Fix `zsh` completion when using `-p`, see #1320 (@xzfc)
|
||||
|
||||
## Other
|
||||
|
||||
- Add note to refer to see detailed help with `--help` (and vice versa with `-h`), see #1215 (@henil)
|
||||
- Add a `Contributors` section to `README`, see #1348 (@adrian-rivera)
|
||||
|
||||
## Syntaxes
|
||||
|
||||
- Manpage syntax highlighting has been improved, see #1315 (@keith-hall)
|
||||
- Add Svelte file syntax, see #1285 (@kjmph)
|
||||
|
||||
## New themes
|
||||
|
||||
- Coldark, see #1329 (@armandphilippot)
|
||||
|
||||
|
||||
# v0.16.0
|
||||
|
||||
## Features
|
||||
|
48
CONTRIBUTING.md
Normal file
48
CONTRIBUTING.md
Normal file
@ -0,0 +1,48 @@
|
||||
# Contributing
|
||||
|
||||
Thank you for considering to contribute to `bat`!
|
||||
|
||||
|
||||
|
||||
## Add an entry to the changelog
|
||||
|
||||
If your contribution changes the behavior of `bat` (as opposed to a typo-fix
|
||||
in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file
|
||||
and describe your changes. This makes the release process much easier and
|
||||
therefore helps to get your changes into a new `bat` release faster.
|
||||
|
||||
The top of the `CHANGELOG` contains a *"unreleased"* section with a few
|
||||
subsections (Features, Bugfixes, …). Please add your entry to the subsection
|
||||
that best describes your change.
|
||||
|
||||
Entries follow this format:
|
||||
```
|
||||
- Short description of what has been changed, see #123 (@user)
|
||||
```
|
||||
Here, `#123` is the number of the original issue and/or your pull request.
|
||||
Please replace `@user` by your GitHub username.
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
Please check out the [Development](https://github.com/sharkdp/bat#development)
|
||||
section in the README.
|
||||
|
||||
|
||||
## Adding a new feature
|
||||
|
||||
Please consider opening a
|
||||
[feature request ticket](https://github.com/sharkdp/bat/issues/new?assignees=&labels=feature-request&template=feature_request.md)
|
||||
first in order to give us a chance to discuss the feature first.
|
||||
|
||||
|
||||
## Adding new syntaxes/languages or themes
|
||||
|
||||
Before you make a pull request that adds a new syntax or theme, please read
|
||||
the [Customization](https://github.com/sharkdp/bat#customization) section
|
||||
in the README first.
|
||||
|
||||
If you really think that a particular syntax or theme should be added for all
|
||||
users, please read the corresponding
|
||||
[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
|
||||
first.
|
813
Cargo.lock
generated
813
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
11
Cargo.toml
11
Cargo.toml
@ -5,9 +5,8 @@ description="A cat(1) clone with wings."
|
||||
homepage = "https://github.com/sharkdp/bat"
|
||||
license = "MIT/Apache-2.0"
|
||||
name = "bat"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/sharkdp/bat"
|
||||
version = "0.16.0"
|
||||
version = "0.17.1"
|
||||
exclude = [
|
||||
"assets/syntaxes/*",
|
||||
"assets/themes/*",
|
||||
@ -38,7 +37,7 @@ regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
|
||||
atty = { version = "0.2.14", optional = true }
|
||||
ansi_term = "^0.12.1"
|
||||
ansi_colours = "^1.0"
|
||||
console = "0.12.0"
|
||||
console = "0.14.0"
|
||||
dirs = { version = "3.0", optional = true }
|
||||
lazy_static = { version = "1.4", optional = true }
|
||||
wild = { version = "2.0", optional = true }
|
||||
@ -58,7 +57,7 @@ optional = true
|
||||
default-features = false
|
||||
|
||||
[dependencies.syntect]
|
||||
version = "4.4.0"
|
||||
version = "4.5.0"
|
||||
default-features = false
|
||||
features = ["parsing", "yaml-load", "dump-load", "dump-create"]
|
||||
|
||||
@ -74,8 +73,8 @@ default-features = false
|
||||
|
||||
[dev-dependencies]
|
||||
tempdir = "0.3"
|
||||
assert_cmd = "1.0.1"
|
||||
predicates = "1.0.5"
|
||||
assert_cmd = "1.0.2"
|
||||
predicates = "1.0.6"
|
||||
|
||||
[build-dependencies]
|
||||
clap = { version = "2.33", optional = true }
|
||||
|
137
README.md
137
README.md
@ -38,14 +38,14 @@ characters:
|
||||
|
||||
### Automatic paging
|
||||
|
||||
`bat` can pipe its own output to a pager (e.g `less`) if the output is too large for one screen.
|
||||
By default, `bat` pipes its own output to a pager (e.g `less`) if the output is too large for one screen.
|
||||
If you would rather `bat` work like `cat` all the time (never page output), you can set `--paging=never` as an option, either on the command line or in your configuration file.
|
||||
If you intend to alias `cat` to `bat` in your shell configuration, you can use `alias cat='bat --paging=never'` to preserve the default behavior.
|
||||
|
||||
### File concatenation
|
||||
#### File concatenation
|
||||
|
||||
Oh.. you can also use it to concatenate files :wink:. Whenever
|
||||
`bat` detects a non-interactive terminal (i.e. when you pipe into another process
|
||||
or into a file), `bat` will act as a drop-in replacement for `cat` and
|
||||
fall back to printing the plain file contents.
|
||||
Even with a pager set, you can still use `bat` to concatenate files :wink:.
|
||||
Whenever `bat` detects a non-interactive terminal (i.e. when you pipe into another process or into a file), `bat` will act as a drop-in replacement for `cat` and fall back to printing the plain file contents, regardless of the `--pager` option's value.
|
||||
|
||||
## How to use
|
||||
|
||||
@ -131,7 +131,18 @@ highlighting:
|
||||
git show v0.6.0:src/main.rs | bat -l rs
|
||||
```
|
||||
|
||||
Note that syntax highlighting within diffs is currently not supported. If you are looking for this, check out [`delta`](https://github.com/dandavison/delta).
|
||||
#### `git diff`
|
||||
|
||||
You can combine `bat` with `git diff` to view lines around code changes with proper syntax
|
||||
highlighting:
|
||||
```bash
|
||||
batdiff() {
|
||||
git diff --name-only --diff-filter=d | xargs bat --diff
|
||||
}
|
||||
```
|
||||
If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
|
||||
|
||||
If you are looking for more support for git and diff operations, check out [`delta`](https://github.com/dandavison/delta).
|
||||
|
||||
#### `xclip`
|
||||
|
||||
@ -169,7 +180,7 @@ The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.
|
||||
|
||||
## Installation
|
||||
|
||||
[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
|
||||
[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
|
||||
|
||||
### On Ubuntu (using `apt`)
|
||||
*... and other Debian-based Linux distributions.*
|
||||
@ -185,7 +196,7 @@ If your Ubuntu/Debian installation is new enough you can simply run:
|
||||
apt install bat
|
||||
```
|
||||
|
||||
If you install `bat` this way, please note that the executable may be installed as `batcat` instead of `bat` (due to [a name
|
||||
**Important**: If you install `bat` this way, please note that the executable may be installed as `batcat` instead of `bat` (due to [a name
|
||||
clash with another package](https://github.com/sharkdp/bat/issues/982)). You can set up a `bat -> batcat` symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:
|
||||
``` bash
|
||||
mkdir -p ~/.local/bin
|
||||
@ -200,7 +211,7 @@ the most recent release of `bat`, download the latest `.deb` package from the
|
||||
[release page](https://github.com/sharkdp/bat/releases) and install it via:
|
||||
|
||||
```bash
|
||||
sudo dpkg -i bat_0.16.0_amd64.deb # adapt version number and architecture
|
||||
sudo dpkg -i bat_0.17.1_amd64.deb # adapt version number and architecture
|
||||
```
|
||||
|
||||
### On Alpine Linux
|
||||
@ -245,6 +256,13 @@ You can install `bat` via xbps-install:
|
||||
xbps-install -S bat
|
||||
```
|
||||
|
||||
### On Termux
|
||||
|
||||
You can install `bat` via pkg:
|
||||
```bash
|
||||
pkg install bat
|
||||
```
|
||||
|
||||
### On FreeBSD
|
||||
|
||||
You can install a precompiled [`bat` package](https://www.freshports.org/textproc/bat) with pkg:
|
||||
@ -276,6 +294,15 @@ You can install `bat` with zypper:
|
||||
zypper install bat
|
||||
```
|
||||
|
||||
### Via snap package
|
||||
|
||||
```
|
||||
sudo snap install batcat
|
||||
```
|
||||
|
||||
[Get it from the Snap Store](https://snapcraft.io/batcat)
|
||||
|
||||
|
||||
### On macOS (or Linux) via Homebrew
|
||||
|
||||
You can install `bat` with [Homebrew on MacOS](https://formulae.brew.sh/formula/bat) or [Homebrew on Linux](https://formulae.brew.sh/formula-linux/bat):
|
||||
@ -336,7 +363,7 @@ higher. You can then use `cargo` to build everything:
|
||||
cargo install --locked bat
|
||||
```
|
||||
|
||||
Note that addition files like the man page or shell completion
|
||||
Note that additional files like the man page or shell completion
|
||||
files can not be installed in this way. They will be generated by `cargo` and should be available in the cargo target folder (under `build`).
|
||||
|
||||
## Customization
|
||||
@ -363,12 +390,11 @@ You can also use a custom theme by following the
|
||||
|
||||
### 8-bit themes
|
||||
|
||||
`bat` has four themes that always use [8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors),
|
||||
`bat` has three themes that always use [8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors),
|
||||
even when truecolor support is available:
|
||||
|
||||
- `ansi-dark` looks decent on any terminal with a dark background. It uses 3-bit colors: black, red,
|
||||
green, yellow, blue, magenta, cyan, and white.
|
||||
- `ansi-light` is like `ansi-dark`, but for terminals with a light background.
|
||||
- `ansi` looks decent on any terminal. It uses 3-bit colors: black, red, green,
|
||||
yellow, blue, magenta, cyan, and white.
|
||||
- `base16` is designed for [base16](https://github.com/chriskempson/base16) terminal themes. It uses
|
||||
4-bit colors (3-bit colors plus bright variants) in accordance with the
|
||||
[base16 styling guidelines](https://github.com/chriskempson/base16/blob/master/styling.md).
|
||||
@ -391,35 +417,45 @@ variable to make these changes permanent or use `bat`s
|
||||
|
||||
### Adding new syntaxes / language definitions
|
||||
|
||||
Should you find that a particular syntax is not available within `bat`, you can follow these
|
||||
instructions to easily add new syntaxes to your current `bat` installation.
|
||||
|
||||
`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
|
||||
library for syntax highlighting. `syntect` can read any
|
||||
[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
|
||||
and theme. To add new syntax definitions, do the following.
|
||||
and theme.
|
||||
|
||||
Create a folder with syntax definition files:
|
||||
A good resource for finding Sublime Syntax packages is [Package Control](https://packagecontrol.io/). Once you found a
|
||||
syntax:
|
||||
|
||||
```bash
|
||||
mkdir -p "$(bat --config-dir)/syntaxes"
|
||||
cd "$(bat --config-dir)/syntaxes"
|
||||
1. Create a folder with syntax definition files:
|
||||
|
||||
# Put new '.sublime-syntax' language definition files
|
||||
# in this folder (or its subdirectories), for example:
|
||||
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
||||
```
|
||||
```bash
|
||||
mkdir -p "$(bat --config-dir)/syntaxes"
|
||||
cd "$(bat --config-dir)/syntaxes"
|
||||
|
||||
Now use the following command to parse these files into a binary cache:
|
||||
# Put new '.sublime-syntax' language definition files
|
||||
# in this folder (or its subdirectories), for example:
|
||||
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
||||
```
|
||||
|
||||
```bash
|
||||
bat cache --build
|
||||
```
|
||||
2. Now use the following command to parse these files into a binary cache:
|
||||
|
||||
Finally, use `bat --list-languages` to check if the new languages are available.
|
||||
```bash
|
||||
bat cache --build
|
||||
```
|
||||
|
||||
If you ever want to go back to the default settings, call:
|
||||
3. Finally, use `bat --list-languages` to check if the new languages are available.
|
||||
|
||||
```bash
|
||||
bat cache --clear
|
||||
```
|
||||
If you ever want to go back to the default settings, call:
|
||||
|
||||
```bash
|
||||
bat cache --clear
|
||||
```
|
||||
|
||||
4. If you think that a specific syntax should be included in `bat` by default, please
|
||||
consider opening a "syntax request" ticket after reading the policies and
|
||||
instructions [here](doc/assets.md): [Open Syntax Request](https://github.com/sharkdp/bat/issues/new?labels=syntax-request&template=syntax_request.md).
|
||||
|
||||
### Adding new themes
|
||||
|
||||
@ -439,6 +475,33 @@ bat cache --build
|
||||
|
||||
Finally, use `bat --list-themes` to check if the new themes are available.
|
||||
|
||||
### Adding or changing file type associations
|
||||
|
||||
You can add new (or change existing) file name patterns using the `--map-syntax`
|
||||
command line option. The option takes an argument of the form `pattern:syntax` where
|
||||
`pattern` is a glob pattern that is matched against the file name and
|
||||
the absolute file path. The `syntax` part is the full name of a supported language
|
||||
(use `bat --list-languages` for an overview)full .
|
||||
|
||||
Note: You probably want to use this option as an entry in `bat`s configuration file instead
|
||||
of passing it on the command line (see below).
|
||||
|
||||
Example: To use "INI" syntax highlighting for all files with a `.conf` file extension, use
|
||||
```bash
|
||||
--map-syntax='*.conf:INI'
|
||||
```
|
||||
|
||||
Example: To open all files called `.ignore` (exact match) with the "Git Ignore" syntax, use:
|
||||
```bash
|
||||
--map-syntax='.ignore:Git Ignore'
|
||||
```
|
||||
|
||||
Example: To open all `.conf` files in subfolders of `/etc/apache2` with the "Apache Conf"
|
||||
syntax, use (this mapping is already built in):
|
||||
```bash
|
||||
-map-syntax='/etc/apache2/**/*.conf:Apache Conf'
|
||||
```
|
||||
|
||||
### Using a different pager
|
||||
|
||||
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
|
||||
@ -490,6 +553,7 @@ and the `GitHub` theme when in the _light mode_.
|
||||
alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
|
||||
```
|
||||
|
||||
|
||||
## Configuration file
|
||||
|
||||
`bat` can also be customized with a configuration file. The location of the file is dependent
|
||||
@ -526,9 +590,6 @@ Example configuration file:
|
||||
|
||||
# Use C++ syntax for .ino files
|
||||
--map-syntax "*.ino:C++"
|
||||
|
||||
# Use ".gitignore"-style highlighting for ".ignore" files
|
||||
--map-syntax ".ignore:Git Ignore"
|
||||
```
|
||||
|
||||
## Using `bat` on Windows
|
||||
@ -630,6 +691,10 @@ bash assets/create.sh
|
||||
cargo install --path . --locked --force
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [sharkdp](https://github.com/sharkdp)
|
||||
|
52
assets/README.md
vendored
52
assets/README.md
vendored
@ -1,52 +0,0 @@
|
||||
## Syntax Highlighting in bat
|
||||
|
||||
`bat` uses the [syntect](https://github.com/trishume/syntect) library to highlight source
|
||||
code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
|
||||
in the `.sublime-syntax` format.
|
||||
|
||||
In order to add new syntaxes to `bat`, follow these steps:
|
||||
|
||||
1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
|
||||
which can be included as a submodule (under `assets/syntaxes`).
|
||||
|
||||
2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
|
||||
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
|
||||
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
|
||||
|
||||
3. Run the `create.sh` script. It calls `bat cache --build` to parse all available
|
||||
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
|
||||
|
||||
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
|
||||
`bat` binary.
|
||||
|
||||
5. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
|
||||
file. A new binary cache file will be created once before every new release of `bat`.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
Make sure that the local cache does not interfere with the internally stored syntaxes and
|
||||
themes (`bat cache --clear`).
|
||||
|
||||
### Manual modifications
|
||||
|
||||
The following files have been manually modified after converting from a `.tmLanguage` file:
|
||||
|
||||
* `Apache.sublime_syntax`=> removed `.conf` and `.CONF` file types.
|
||||
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
||||
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
|
||||
* `Org mode.sublime-syntax` => removed `task` file type.
|
||||
* `SML.sublime_syntax` => removed `ml` file type.
|
||||
|
||||
### Non-submodule additions
|
||||
|
||||
* `Assembly (x86_64)` has been manually added from https://github.com/13xforever/x86-assembly-textmate-bundle due to `git clone` recursion problems
|
||||
* `Nim.sublime-syntax` has been added manually from https://github.com/getzola/zola/blob/master/sublime_syntaxes/Nim.sublime-syntax as there was no suitable Git repository for it. The original syntax seems to originate from https://github.com/Varriount/NimLime
|
||||
* `Rego.sublime-syntax` has been added manually from https://github.com/open-policy-agent/opa/blob/master/misc/syntax/sublime/rego.sublime-syntax
|
||||
as it is not kept in a standalone repository. The file is generated from
|
||||
https://github.com/open-policy-agent/opa/blob/master/misc/syntax/textmate/Rego.tmLanguage
|
||||
* `SML.sublime_syntax` has been added manually from
|
||||
https://github.com/seanjames777/SML-Language-Definitiona as it is not
|
||||
kept in a standalone repository. The file generated is from
|
||||
https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage
|
||||
* `Cabal.sublime_syntax` has been added manually from
|
||||
https://github.com/SublimeHaskell/SublimeHaskell/ - we don't want to include the whole submodule because it includes other syntaxes ("Haskell improved") as well.
|
20
assets/completions/bat.zsh.in
vendored
20
assets/completions/bat.zsh.in
vendored
@ -3,8 +3,8 @@
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
(( $+functions[_cache_subcommand] )) ||
|
||||
_cache_subcommand() {
|
||||
(( $+functions[_{{PROJECT_EXECUTABLE}}_cache_subcommand] )) ||
|
||||
_{{PROJECT_EXECUTABLE}}_cache_subcommand() {
|
||||
local -a args
|
||||
args=(
|
||||
'(-b --build -c --clear)'{-b,--build}'[Initialize or update the syntax/theme cache]'
|
||||
@ -19,12 +19,12 @@ _cache_subcommand() {
|
||||
_arguments -S -s $args
|
||||
}
|
||||
|
||||
(( $+functions[_main] )) ||
|
||||
_main() {
|
||||
(( $+functions[_{{PROJECT_EXECUTABLE}}_main] )) ||
|
||||
_{{PROJECT_EXECUTABLE}}_main() {
|
||||
local -a args
|
||||
args=(
|
||||
'(-A --show-all)'{-A,--show-all}'[Show non-printable characters (space, tab, newline, ..)]'
|
||||
{-p,--plain}'[Show plain style (alias for `--style=plain`)]:When `-p` is used twice (`-pp`), it also disables automatic paging (alias for `--style=plain --paging=never`)'
|
||||
'*'{-p,--plain}'[Show plain style (alias for `--style=plain`), repeat twice to disable disable automatic paging (alias for `--paging=never`)]'
|
||||
'(-l --language)'{-l+,--language=}'[Set the language for syntax highlighting]:<language>:->language'
|
||||
'(-H --highlight-line)'{-H,--highlight-line}'[Highlight lines N through M]:<N\:M>...'
|
||||
'(--file-name)'--file-name'[Specify the name to display for a file]:<name>...:_files'
|
||||
@ -51,13 +51,13 @@ _main() {
|
||||
|
||||
_arguments -S -s $args
|
||||
|
||||
case "$state" in
|
||||
case "$state" in
|
||||
language)
|
||||
local IFS=$'\n'
|
||||
local -a languages
|
||||
languages=( $({{PROJECT_EXECUTABLE}} --list-languages | awk -F':|,' '{ for (i = 1; i <= NF; ++i) printf("%s:%s\n", $i, $1) }') )
|
||||
|
||||
_describe 'language' languages
|
||||
_describe 'language' languages
|
||||
;;
|
||||
|
||||
theme)
|
||||
@ -79,15 +79,15 @@ if (( ${#words} == 2 )); then
|
||||
local -a subcommands
|
||||
subcommands=('cache:Modify the syntax-definition and theme cache')
|
||||
_describe subcommand subcommands
|
||||
_main
|
||||
_{{PROJECT_EXECUTABLE}}_main
|
||||
else
|
||||
case $words[2] in
|
||||
cache)
|
||||
_cache_subcommand
|
||||
_{{PROJECT_EXECUTABLE}}_cache_subcommand
|
||||
;;
|
||||
|
||||
*)
|
||||
_main
|
||||
_{{PROJECT_EXECUTABLE}}_main
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
2
assets/manual/bat.1.in
vendored
2
assets/manual/bat.1.in
vendored
@ -129,7 +129,7 @@ Configure which elements (line numbers, file headers, grid borders, Git modifica
|
||||
of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
|
||||
To set a default style, add the '\-\-style=".."' option to the configuration file or
|
||||
export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
|
||||
values: *auto*, full, plain, changes, header, grid, numbers, snip.
|
||||
values: *auto*, full, plain, changes, header, grid, rule, numbers, snip.
|
||||
.HP
|
||||
\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
|
||||
.IP
|
||||
|
15
assets/patches/ShellScript.sublime-syntax.patch
vendored
Normal file
15
assets/patches/ShellScript.sublime-syntax.patch
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git syntaxes/01_Packages/ShellScript/Bash.sublime-syntax syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
|
||||
index e973e319..a703cef8 100644
|
||||
--- syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
|
||||
+++ syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
|
||||
@@ -30,8 +30,8 @@ file_extensions:
|
||||
- .zshenv
|
||||
- .zshrc
|
||||
- PKGBUILD # https://jlk.fjfi.cvut.cz/arch/manpages/man/PKGBUILD.5
|
||||
- - .ebuild
|
||||
- - .eclass
|
||||
+ - ebuild
|
||||
+ - eclass
|
||||
|
||||
first_line_match: |
|
||||
(?x)
|
BIN
assets/syntaxes.bin
vendored
BIN
assets/syntaxes.bin
vendored
Binary file not shown.
2
assets/syntaxes/02_Extra/AWK
vendored
2
assets/syntaxes/02_Extra/AWK
vendored
@ -1 +1 @@
|
||||
Subproject commit e593eb6d42a5f1881ba6c75698bd0fb78a9b8871
|
||||
Subproject commit e23926eca1b6a0bd0b572b7191aead9f77c748d1
|
2
assets/syntaxes/02_Extra/CMake
vendored
2
assets/syntaxes/02_Extra/CMake
vendored
@ -1 +1 @@
|
||||
Subproject commit aba96a0862369e9f960bb63a38e2d7563ea6475e
|
||||
Subproject commit 21e96989d604d64f12d518f4f17fc71fa3cdc505
|
2
assets/syntaxes/02_Extra/Elixir
vendored
2
assets/syntaxes/02_Extra/Elixir
vendored
@ -1 +1 @@
|
||||
Subproject commit 4ee539b43d82388f449535f7316d69f5dfeaabb5
|
||||
Subproject commit 4fb01891dd17434dde42887bc821917a30f4e010
|
2
assets/syntaxes/02_Extra/GraphQL
vendored
2
assets/syntaxes/02_Extra/GraphQL
vendored
@ -1 +1 @@
|
||||
Subproject commit c9d84587eb1a6eb34457a875f21b9b1a29306be3
|
||||
Subproject commit 59304d6c7b5019091b532a3197251e393e1db7b2
|
3
assets/syntaxes/02_Extra/INI.sublime-syntax
vendored
3
assets/syntaxes/02_Extra/INI.sublime-syntax
vendored
@ -25,12 +25,13 @@ contexts:
|
||||
scope: comment.line.semicolon.ini
|
||||
captures:
|
||||
1: punctuation.definition.comment.ini
|
||||
- match: '^\s*(\[)(.*?)(\])'
|
||||
- match: '^\s*(\[)(.*?)(\])\s*(;.*)?$\n?'
|
||||
scope: meta.tag.section.ini
|
||||
captures:
|
||||
1: punctuation.definition.section.ini
|
||||
2: entity.section.ini
|
||||
3: punctuation.definition.section.ini
|
||||
4: comment.definition.section.ini
|
||||
- match: '^(\s*(["'']?)(.+?)(\2)\s*(=))?\s*((["'']?)(.*?)(\7))\s*(;.*)?$\n?'
|
||||
scope: meta.declaration.ini
|
||||
captures:
|
||||
|
2
assets/syntaxes/02_Extra/Julia
vendored
2
assets/syntaxes/02_Extra/Julia
vendored
@ -1 +1 @@
|
||||
Subproject commit 6c0d770fc74e6bc037c70cae1f94fe113b60fd95
|
||||
Subproject commit e2b1cb549d57368b7b22e79430a1d5f47555e802
|
1
assets/syntaxes/02_Extra/Lean
vendored
Submodule
1
assets/syntaxes/02_Extra/Lean
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 7e99440b33c834b11deda67144a6a7ce5a666f0e
|
125
assets/syntaxes/02_Extra/Lean.sublime-syntax
vendored
Normal file
125
assets/syntaxes/02_Extra/Lean.sublime-syntax
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
%YAML 1.2
|
||||
---
|
||||
# http://www.sublimetext.com/docs/3/syntax.html
|
||||
name: Lean
|
||||
file_extensions:
|
||||
- lean
|
||||
scope: source.lean
|
||||
contexts:
|
||||
main:
|
||||
- include: comments
|
||||
- match: '\b(?<!\.)(inductive|coinductive|structure|theorem|axiom|axioms|abbreviation|lemma|definition|def|instance|class|constant)\b\s+(\{[^}]*\})?'
|
||||
captures:
|
||||
1: keyword.other.definitioncommand.lean
|
||||
push:
|
||||
- meta_scope: meta.definitioncommand.lean
|
||||
- match: '(?=\bwith\b|\bextends\b|[:\|\(\[\{⦃<>])'
|
||||
pop: true
|
||||
- include: comments
|
||||
- include: definitionName
|
||||
- match: ","
|
||||
- match: \b(Prop|Type|Sort)\b
|
||||
scope: storage.type.lean
|
||||
- match: '\battribute\b\s*\[[^\]]*\]'
|
||||
scope: storage.modifier.lean
|
||||
- match: '@\[[^\]]*\]'
|
||||
scope: storage.modifier.lean
|
||||
- match: \b(?<!\.)(private|meta|mutual|protected|noncomputable)\b
|
||||
scope: keyword.control.definition.modifier.lean
|
||||
- match: \b(sorry)\b
|
||||
scope: invalid.illegal.lean
|
||||
- match: '#print\s+(def|definition|inductive|instance|structure|axiom|axioms|class)\b'
|
||||
scope: keyword.other.command.lean
|
||||
- match: '#(print|eval|reduce|check|help|exit|find|where)\b'
|
||||
scope: keyword.other.command.lean
|
||||
- match: \b(?<!\.)(import|export|prelude|theory|definition|def|abbreviation|instance|renaming|hiding|exposing|parameter|parameters|begin|constant|constants|lemma|variable|variables|theorem|example|open|axiom|inductive|coinductive|with|structure|universe|universes|alias|precedence|reserve|postfix|prefix|infix|infixl|infixr|notation|end|using|namespace|section|local|set_option|extends|include|omit|class|classes|instances|raw|run_cmd|restate_axiom)(?!\.)\b
|
||||
scope: keyword.other.lean
|
||||
- match: \b(?<!\.)(calc|have|this|match|do|suffices|show|by|in|at|let|forall|fun|exists|assume|from|obtain|haveI|λ)(?!\.)\b
|
||||
scope: keyword.other.lean
|
||||
- match: «
|
||||
push:
|
||||
- meta_content_scope: entity.name.lean
|
||||
- match: »
|
||||
pop: true
|
||||
- match: \b(?<!\.)(if|then|else)\b
|
||||
scope: keyword.control.lean
|
||||
- match: '"'
|
||||
captures:
|
||||
0: punctuation.definition.string.begin.lean
|
||||
push:
|
||||
- meta_scope: string.quoted.double.lean
|
||||
- match: '"'
|
||||
captures:
|
||||
0: punctuation.definition.string.end.lean
|
||||
pop: true
|
||||
- match: '\\[\\"nt'']'
|
||||
scope: constant.character.escape.lean
|
||||
- match: '\\x[0-9A-Fa-f][0-9A-Fa-f]'
|
||||
scope: constant.character.escape.lean
|
||||
- match: '\\u[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]'
|
||||
scope: constant.character.escape.lean
|
||||
- match: '''[^\\'']'''
|
||||
scope: string.quoted.single.lean
|
||||
- match: '''(\\(x..|u....|.))'''
|
||||
scope: string.quoted.single.lean
|
||||
captures:
|
||||
1: constant.character.escape.lean
|
||||
- match: '`+[^\[(]\S+'
|
||||
scope: entity.name.lean
|
||||
- match: '\b([0-9]+|0([xX][0-9a-fA-F]+))\b'
|
||||
scope: constant.numeric.lean
|
||||
blockComment:
|
||||
- match: /-
|
||||
push:
|
||||
- meta_scope: comment.block.lean
|
||||
- match: "-/"
|
||||
pop: true
|
||||
- include: scope:source.lean.markdown
|
||||
- include: blockComment
|
||||
comments:
|
||||
- include: dashComment
|
||||
- include: docComment
|
||||
- include: stringBlock
|
||||
- include: modDocComment
|
||||
- include: blockComment
|
||||
dashComment:
|
||||
- match: (--)
|
||||
captures:
|
||||
0: punctuation.definition.comment.lean
|
||||
push:
|
||||
- meta_scope: comment.line.double-dash.lean
|
||||
- match: $
|
||||
pop: true
|
||||
- include: scope:source.lean.markdown
|
||||
definitionName:
|
||||
- match: '\b[^:«»\(\)\{\}[:space:]=→λ∀?][^:«»\(\)\{\}[:space:]]*'
|
||||
scope: entity.name.function.lean
|
||||
- match: «
|
||||
push:
|
||||
- meta_content_scope: entity.name.function.lean
|
||||
- match: »
|
||||
pop: true
|
||||
docComment:
|
||||
- match: /--
|
||||
push:
|
||||
- meta_scope: comment.block.documentation.lean
|
||||
- match: "-/"
|
||||
pop: true
|
||||
- include: scope:source.lean.markdown
|
||||
- include: blockComment
|
||||
modDocComment:
|
||||
- match: /-!
|
||||
push:
|
||||
- meta_scope: comment.block.documentation.lean
|
||||
- match: "-/"
|
||||
pop: true
|
||||
- include: scope:source.lean.markdown
|
||||
- include: blockComment
|
||||
stringBlock:
|
||||
- match: /-"
|
||||
push:
|
||||
- meta_scope: comment.block.string.lean
|
||||
- match: '"-/'
|
||||
pop: true
|
||||
- include: scope:source.lean.markdown
|
||||
- include: blockComment
|
166
assets/syntaxes/02_Extra/Manpage.sublime-syntax
vendored
166
assets/syntaxes/02_Extra/Manpage.sublime-syntax
vendored
@ -7,47 +7,157 @@ file_extensions:
|
||||
scope: source.man
|
||||
|
||||
variables:
|
||||
section_heading: '^\S.*$'
|
||||
section_heading: '^(?!#)\S.*$'
|
||||
command_line_option: '(--?[A-Za-z0-9][_A-Za-z0-9-]*)'
|
||||
|
||||
contexts:
|
||||
prototype:
|
||||
# ignore syntax test lines
|
||||
- match: '^#'
|
||||
push:
|
||||
- meta_scope: comment.syntax-test.man
|
||||
- match: $\n?
|
||||
pop: true
|
||||
main:
|
||||
- match: ^
|
||||
push: first_line
|
||||
|
||||
first_line:
|
||||
- match: '([A-Z0-9_\-]+)(\()([^)]+)(\))'
|
||||
- match: '([A-Z0-9_\-]+)(\()([^)]+)(\))\s*'
|
||||
captures:
|
||||
1: meta.preprocessor
|
||||
2: keyword.operator
|
||||
3: string.quoted.other
|
||||
4: keyword.operator
|
||||
|
||||
- match: '$'
|
||||
push: body
|
||||
|
||||
body:
|
||||
- match: '^(SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
|
||||
push: Packages/C/C.sublime-syntax
|
||||
scope: markup.heading
|
||||
with_prototype:
|
||||
- match: '(?={{section_heading}})'
|
||||
1: meta.preprocessor.man
|
||||
2: keyword.operator.man
|
||||
3: string.quoted.other.man
|
||||
4: keyword.operator.man
|
||||
push:
|
||||
- match: (?:[\w'-]+|\s(?!\s))
|
||||
scope: markup.heading.title.man
|
||||
- match: \s\s
|
||||
pop: true
|
||||
- match: '(?=\S|$)'
|
||||
pop: true
|
||||
|
||||
- match: '^\S.*$'
|
||||
scope: markup.heading
|
||||
- match: '$'
|
||||
set: body
|
||||
|
||||
body:
|
||||
# English, ..., ..., ..., Russian, ...
|
||||
|
||||
- match: '^(?:SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
|
||||
scope: markup.heading.synopsis.man
|
||||
embed: synopsis
|
||||
escape: '(?={{section_heading}})'
|
||||
|
||||
- match: '^(?:USAGE)'
|
||||
scope: markup.heading.synopsis.man
|
||||
embed: synopsis
|
||||
escape: '(?={{section_heading}})'
|
||||
|
||||
- match: '{{section_heading}}'
|
||||
scope: markup.heading.other.man
|
||||
embed: options # some man pages put command line options under the description heading
|
||||
escape: '(?={{section_heading}})'
|
||||
|
||||
function-call:
|
||||
- match: '\b([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
|
||||
captures:
|
||||
1: entity.name.function
|
||||
2: keyword.operator
|
||||
3: constant.numeric
|
||||
4: keyword.operator
|
||||
1: entity.name.function.man
|
||||
2: keyword.operator.man
|
||||
3: constant.numeric.man
|
||||
4: keyword.operator.man
|
||||
|
||||
options:
|
||||
# command-line options like --option=value, --some-flag, or -x
|
||||
- match: '(?:[^a-zA-Z0-9_-]|^|\s)(--?[A-Za-z0-9][A-Za-z0-9-]*)(?:(=)?("?)([A-Za-z0-9]+)("?))?'
|
||||
- match: '^[ ]{7}(?=-)'
|
||||
push: expect-command-line-option
|
||||
- match: '(?:[^a-zA-Z0-9_-]|^|\s){{command_line_option}}'
|
||||
captures:
|
||||
1: entity.name
|
||||
2: keyword.operator
|
||||
3: punctuation.definition.string.begin
|
||||
4: variable.parameter
|
||||
3: punctuation.definition.string.end
|
||||
1: entity.name.command-line-option
|
||||
push:
|
||||
- match: '='
|
||||
scope: keyword.operator.man
|
||||
set:
|
||||
- match: '[^],.() ]+'
|
||||
scope: variable.parameter.man
|
||||
pop: true
|
||||
- match: $
|
||||
pop: true
|
||||
- match: ''
|
||||
pop: true
|
||||
- include: function-call
|
||||
- include: c-code
|
||||
|
||||
expect-command-line-option:
|
||||
- match: '[A-Za-z0-9-]+'
|
||||
scope: entity.name.command-line-option.man
|
||||
- match: '(\[)(=)'
|
||||
captures:
|
||||
1: punctuation.section.brackets.begin.man
|
||||
2: keyword.operator.man
|
||||
push: [command-line-option-or-pipe, expect-parameter]
|
||||
- match: '\['
|
||||
push:
|
||||
- meta_scope: entity.name.command-line-option.man
|
||||
- match: '\]'
|
||||
pop: true
|
||||
- match: '='
|
||||
scope: keyword.operator.man
|
||||
push: expect-parameter
|
||||
- match: (?=.*\.)
|
||||
pop: true
|
||||
- match: '\s'
|
||||
push: expect-parameter
|
||||
- match: '(,)\s*'
|
||||
captures:
|
||||
1: punctuation.separator.man
|
||||
- match: $|(?=\])
|
||||
pop: true
|
||||
|
||||
expect-parameter:
|
||||
- match: '[A-Za-z0-9-]+'
|
||||
scope: variable.parameter.man
|
||||
- match: (?=\s+\|)
|
||||
pop: true
|
||||
- match: \|
|
||||
scope: keyword.operator.logical.man
|
||||
- match: '\['
|
||||
scope: punctuation.section.brackets.begin.man
|
||||
push:
|
||||
- match: '\]'
|
||||
scope: punctuation.section.brackets.end.man
|
||||
pop: true
|
||||
- include: expect-parameter
|
||||
- match: '$|(?=[],]|{{command_line_option}})'
|
||||
pop: true
|
||||
|
||||
c-code:
|
||||
- match: '^(?=\s+(?:#include\b|#define\b|/\*|struct\s+(\w+\s*)?\{))'
|
||||
embed: scope:source.c
|
||||
#embed_scope: source.c.embedded.man
|
||||
#escape: ^(?!#|\1|\s*(?:$|/\*|#include\b|#define\b))
|
||||
escape: ^(?=\s*(?:\(.*\.\)\s*$|[A-Z](?![A-Z])))
|
||||
|
||||
synopsis:
|
||||
- include: c-code
|
||||
- match: \[
|
||||
scope: punctuation.section.brackets.begin.man
|
||||
push: command-line-option-or-pipe
|
||||
- include: options
|
||||
|
||||
command-line-option-or-pipe:
|
||||
- match: (\|)\s*
|
||||
captures:
|
||||
1: keyword.operator.logical.man
|
||||
#- match: (?={{command_line_option}})
|
||||
- match: \w+-\w+
|
||||
- match: (?=-)
|
||||
push:
|
||||
- match: (?=\s*\|)
|
||||
pop: true
|
||||
- include: expect-command-line-option
|
||||
- match: \]
|
||||
scope: punctuation.section.brackets.end.man
|
||||
pop: true
|
||||
- match: \[
|
||||
scope: punctuation.section.brackets.begin.man
|
||||
push: command-line-option-or-pipe
|
||||
|
1
assets/syntaxes/02_Extra/Ninja
vendored
Submodule
1
assets/syntaxes/02_Extra/Ninja
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 25830aaec9316b7fca6600000535214164525d7a
|
52
assets/syntaxes/02_Extra/Ninja.sublime-syntax
vendored
Normal file
52
assets/syntaxes/02_Extra/Ninja.sublime-syntax
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
%YAML 1.2
|
||||
---
|
||||
# http://www.sublimetext.com/docs/3/syntax.html
|
||||
name: Ninja
|
||||
file_extensions:
|
||||
- ninja
|
||||
scope: source.ninja
|
||||
contexts:
|
||||
main:
|
||||
- match: (#).*$\n?
|
||||
comment: Comment line.
|
||||
scope: comment.line.number-sign.ninja
|
||||
captures:
|
||||
1: punctuation.definition.comment.ninja
|
||||
- match: ^(rule)\b
|
||||
comment: Rule keyword and keywords for a rule.
|
||||
captures:
|
||||
1: keyword.other.ninja
|
||||
push:
|
||||
- match: ^(?=\S)
|
||||
pop: true
|
||||
- include: main
|
||||
- match: \b(?:command|deps|depfile|description|generator|pool|restat|rspfile|rspfile_content)\b
|
||||
scope: keyword.other.ninja
|
||||
- match: ^(pool)\b
|
||||
comment: Pool keyword and keywords for a pool.
|
||||
captures:
|
||||
1: keyword.other.ninja
|
||||
push:
|
||||
- match: ^(?=\S)
|
||||
pop: true
|
||||
- include: main
|
||||
- match: \b(?:depth)\b
|
||||
scope: keyword.other.ninja
|
||||
- match: ^(?:build|rule|default|include|subninja)\b
|
||||
comment: Other Keywords.
|
||||
scope: keyword.other.ninja
|
||||
- match: '(?:[=:]|\|{1,2})(?=\s)'
|
||||
comment: Operators for variable assignment (=), rule definition (:), implicit (|) and order only (||) dependencies.
|
||||
scope: keyword.operator.ninja
|
||||
- match: \$$
|
||||
comment: Line wrap.
|
||||
scope: keyword.operator.ninja
|
||||
- match: \$\$
|
||||
comment: Dollar literal.
|
||||
scope: keyword.operator.ninja
|
||||
- match: '\$[[:alnum:]_-]+'
|
||||
comment: Simple variables, e.g. $var.
|
||||
scope: variable.other.ninja
|
||||
- match: '\${[[:alnum:]_.-]+}'
|
||||
comment: "Variables, e.g. ${some.var.name}."
|
||||
scope: variable.other.ninja
|
@ -1,9 +1,10 @@
|
||||
%YAML 1.2
|
||||
---
|
||||
# http://www.sublimetext.com/docs/3/syntax.html
|
||||
name: Robot Framework syntax highlighting.
|
||||
name: Robot Framework
|
||||
file_extensions:
|
||||
- robot
|
||||
- resource
|
||||
scope: source.robot
|
||||
contexts:
|
||||
main:
|
||||
|
2
assets/syntaxes/02_Extra/SCSS_Sass
vendored
2
assets/syntaxes/02_Extra/SCSS_Sass
vendored
@ -1 +1 @@
|
||||
Subproject commit bc6332c1be2c5590d334a2a58d3b83a8d07ac7ef
|
||||
Subproject commit 4868322030c3644d6b8cfff68c85849789d9bdb2
|
1
assets/syntaxes/02_Extra/Svelte
vendored
Submodule
1
assets/syntaxes/02_Extra/Svelte
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit aee0676f379c0503f9c557e24aa2816575e0a4d1
|
2
assets/syntaxes/02_Extra/Terraform
vendored
2
assets/syntaxes/02_Extra/Terraform
vendored
@ -1 +1 @@
|
||||
Subproject commit 64208ea816d940e4b9c93f4a6b67d64c02a09825
|
||||
Subproject commit 54d8350c3c5929c921ea7561c932aa15e7d96c48
|
2
assets/syntaxes/02_Extra/TypeScript
vendored
2
assets/syntaxes/02_Extra/TypeScript
vendored
@ -1 +1 @@
|
||||
Subproject commit 603ebb48b162bc453a0bb2cbb0192f3606819f6d
|
||||
Subproject commit a607ddfec90648c1c2f33f8306733f6aec5d2b78
|
2
assets/syntaxes/02_Extra/VimL
vendored
2
assets/syntaxes/02_Extra/VimL
vendored
@ -1 +1 @@
|
||||
Subproject commit ed40c3bc814cd0c8107dbbb8fcd95946b33217f0
|
||||
Subproject commit 23afc890977bb1fd43fd05e7d983f994993d4982
|
4
assets/syntaxes/02_Extra/VimL.sublime-syntax
vendored
4
assets/syntaxes/02_Extra/VimL.sublime-syntax
vendored
@ -75,10 +75,10 @@ contexts:
|
||||
- match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
|
||||
scope: string.quoted.single.viml
|
||||
string_regex:
|
||||
- match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
|
||||
- match: '[gvs]{1}/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
|
||||
scope: string.regexp.viml
|
||||
support_function:
|
||||
- match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
|
||||
- match: \b(set(local|global)?|let|command|filetype|syntax|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
|
||||
scope: support.function.viml
|
||||
support_type:
|
||||
- match: <.*?>
|
||||
|
1
assets/syntaxes/02_Extra/Zig
vendored
Submodule
1
assets/syntaxes/02_Extra/Zig
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 87ecbcae6fb5718369ce3bb3472ca0b2634e78e6
|
2
assets/syntaxes/02_Extra/ssh-config
vendored
2
assets/syntaxes/02_Extra/ssh-config
vendored
@ -1 +1 @@
|
||||
Subproject commit 1ddcb320aca1bf31b0048a3109540475d5af64e2
|
||||
Subproject commit 201816b609abf7ccf583f7e888f6dc4121410d70
|
151
assets/syntaxes/02_Extra/syntax_test_man.man
vendored
Normal file
151
assets/syntaxes/02_Extra/syntax_test_man.man
vendored
Normal file
@ -0,0 +1,151 @@
|
||||
# SYNTAX TEST "Manpage.sublime-syntax"
|
||||
SOMETHING(8) System Manager's Manual SOMETHING(8)
|
||||
# ^^^^^ meta.preprocessor
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.title
|
||||
# ^^^^^^^ meta.preprocessor
|
||||
|
||||
NAME
|
||||
#^^^ markup.heading.other
|
||||
example - do something useful
|
||||
|
||||
SYNOPSIS
|
||||
example [options] [--home DIR] [--shell SHELL] [--no-create-home]
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^^^^^^ entity.name.command-line-option
|
||||
# ^^^ variable.parameter
|
||||
# ^ punctuation.section.brackets.end
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^^^^^^^ entity.name.command-line-option
|
||||
# ^^^^^ variable.parameter
|
||||
# ^ punctuation.section.brackets.end
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^^^^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
# ^ punctuation.section.brackets.end
|
||||
[-u | --set-upstream] [-o <string> | --push-option=<string>]
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^^ entity.name.command-line-option
|
||||
# ^ keyword.operator.logical
|
||||
# ^^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
# ^ punctuation.section.brackets.end
|
||||
# ^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
[--force-with-lease[=<refname>[:<expect>]]]
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^ keyword.operator
|
||||
# ^^^^^^^ variable.parameter
|
||||
# ^ punctuation.section.brackets.begin
|
||||
# ^^^^^^ variable.parameter
|
||||
# ^^^ punctuation.section.brackets.end
|
||||
|
||||
example --system [options]
|
||||
# ^^^^^^^^ entity.name
|
||||
|
||||
COMMON OPTIONS
|
||||
[--quiet] [--debug] [--help|-h] [--version] [--conf FILE]
|
||||
|
||||
/* According to POSIX.1-2001, POSIX.1-2008 */
|
||||
# ^^ source.c comment.block punctuation.definition.comment
|
||||
#include <sys/select.h>
|
||||
# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include
|
||||
struct timeval {
|
||||
# ^^^^^^ source.c storage.type
|
||||
|
||||
time_t tv_sec; /* seconds */
|
||||
suseconds_t tv_usec; /* microseconds */
|
||||
};
|
||||
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
example does something useful in relation to the command line options
|
||||
and configuration information in /etc/example.conf.
|
||||
|
||||
OPTIONS
|
||||
--conf FILE
|
||||
# ^^^^^^ entity.name.command-line-option
|
||||
#^^^^^^ - variable - entity - markup
|
||||
# ^^^^ variable.parameter
|
||||
Use FILE instead of /etc/example.conf.
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - variable - entity
|
||||
|
||||
--disabled-login
|
||||
Do not run passwd to set the password. The user won't be able
|
||||
to use her account until the password is set.
|
||||
|
||||
--disabled-password
|
||||
Like --disabled-login, but logins are still possible (for exam-
|
||||
# ^^^^^^^^^^^^^^^^ entity.name
|
||||
#^^^^^^^^^^^^^^^^^^ - entity - variable - markup
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - entity - variable - markup
|
||||
ple using SSH RSA keys) but not using password authentication.
|
||||
|
||||
--help Display brief instructions.
|
||||
# ^^^^^^ entity.name.command-line-option
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - variable.parameter
|
||||
|
||||
--home DIR
|
||||
# ^^^^^^ entity.name.command-line-option
|
||||
# ^^^ variable.parameter
|
||||
# ^ - variable - entity - markup
|
||||
Use DIR as the user's home directory, rather than the default
|
||||
specified by the configuration file. If the directory does not
|
||||
exist, it is created and skeleton files are copied.
|
||||
|
||||
--[no-]signed, --signed=(true|false|if-asked)
|
||||
# ^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
# ^ punctuation.separator
|
||||
# ^^^^^^^^ entity.name.command-line-option
|
||||
# ^ keyword.operator
|
||||
# ^ - variable
|
||||
# ^^^^ variable.parameter
|
||||
# ^ keyword.operator.logical
|
||||
# ^^^^^ variable.parameter
|
||||
# ^ keyword.operator.logical
|
||||
# ^^^^^^^^ variable.parameter
|
||||
# ^ - variable
|
||||
--no-recurse-submodules, --recurse-submodules=check|on-demand|only|no
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
# ^ punctuation.separator
|
||||
# ^^^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
|
||||
# ^ keyword.operator
|
||||
# ^^^^^ variable.parameter
|
||||
# ^ keyword.operator.logical
|
||||
# ^^^^^^^^^ variable.parameter
|
||||
# ^ keyword.operator.logical
|
||||
# ^^^^ variable.parameter
|
||||
# ^ keyword.operator.logical
|
||||
# ^^ variable.parameter
|
||||
May be used to make sure all submodule commits used by the
|
||||
|
||||
-c, -C NUM, --context[=NUM]
|
||||
# ^^ entity.name.command-line-option
|
||||
# ^ punctuation.separator
|
||||
# ^^ entity.name.command-line-option
|
||||
# ^^^ variable.parameter
|
||||
# ^ punctuation.separator
|
||||
# ^^^^^^^^^ entity.name.command-line-option
|
||||
# ^^^^^^^ - entity.name
|
||||
# ^ keyword.operator
|
||||
# ^^^ variable.parameter
|
||||
# ^^ - variable
|
||||
output NUM (default 3) lines of copied context
|
||||
|
||||
EXAMPLE
|
||||
#include <stdio.h>
|
||||
# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include
|
||||
|
||||
(This is not C code.)
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^ - source.c
|
||||
|
||||
struct timeval {
|
||||
time_t tv_sec; /* seconds */
|
||||
suseconds_t tv_usec; /* microseconds */
|
||||
};
|
||||
# ^ source.c punctuation.terminator
|
||||
|
||||
The corresponding argument for pselect() has the following type:
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - source.c
|
||||
#define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |
|
||||
EPOLLHUP | EPOLLERR)
|
||||
# ^ source.c meta.preprocessor.macro meta.group punctuation.section.group.end
|
BIN
assets/themes.bin
vendored
BIN
assets/themes.bin
vendored
Binary file not shown.
1
assets/themes/Coldark
vendored
Submodule
1
assets/themes/Coldark
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit e44750b2a9629dd12d8ed3ad9fd50c77232170b9
|
504
assets/themes/ansi-light.tmTheme
vendored
504
assets/themes/ansi-light.tmTheme
vendored
@ -1,504 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!--
|
||||
The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
|
||||
palette number from 00 to 0f, and AA is the special value 00 to indicate
|
||||
that this encoding is being used.
|
||||
-->
|
||||
<key>author</key>
|
||||
<string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
|
||||
<key>name</key>
|
||||
<string>ANSI Light</string>
|
||||
<key>colorSpaceName</key>
|
||||
<string>sRGB</string>
|
||||
<key>settings</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#07000000</string>
|
||||
<key>caret</key>
|
||||
<string>#00000000</string>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
<key>invisibles</key>
|
||||
<string>#00000000</string>
|
||||
<key>lineHighlight</key>
|
||||
<string>#00000000</string>
|
||||
<key>selection</key>
|
||||
<string>#00000000</string>
|
||||
<key>gutter</key>
|
||||
<string>#07000000</string>
|
||||
<key>gutterForeground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Text</string>
|
||||
<key>scope</key>
|
||||
<string>variable.parameter.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Comments</string>
|
||||
<key>scope</key>
|
||||
<string>comment, punctuation.definition.comment</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#02000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Punctuation</string>
|
||||
<key>scope</key>
|
||||
<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Delimiters</string>
|
||||
<key>scope</key>
|
||||
<string>none</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Operators</string>
|
||||
<key>scope</key>
|
||||
<string>keyword.operator</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Keywords</string>
|
||||
<key>scope</key>
|
||||
<string>keyword</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Variables</string>
|
||||
<key>scope</key>
|
||||
<string>variable</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Functions</string>
|
||||
<key>scope</key>
|
||||
<string>entity.name.function, meta.require, support.function.any-method</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#04000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Labels</string>
|
||||
<key>scope</key>
|
||||
<string>entity.name.label</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#06000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Classes</string>
|
||||
<key>scope</key>
|
||||
<string>support.class, entity.name.class, entity.name.type.class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Classes</string>
|
||||
<key>scope</key>
|
||||
<string>meta.class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Methods</string>
|
||||
<key>scope</key>
|
||||
<string>keyword.other.special-method</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#04000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Storage</string>
|
||||
<key>scope</key>
|
||||
<string>storage</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Support</string>
|
||||
<key>scope</key>
|
||||
<string>support.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#06000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Strings, Inherited Class</string>
|
||||
<key>scope</key>
|
||||
<string>string, constant.other.symbol, entity.other.inherited-class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#02000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Integers</string>
|
||||
<key>scope</key>
|
||||
<string>constant.numeric</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Floats</string>
|
||||
<key>scope</key>
|
||||
<string>none</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Boolean</string>
|
||||
<key>scope</key>
|
||||
<string>none</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Constants</string>
|
||||
<key>scope</key>
|
||||
<string>constant</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Tags</string>
|
||||
<key>scope</key>
|
||||
<string>entity.name.tag</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#01000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Attributes</string>
|
||||
<key>scope</key>
|
||||
<string>entity.other.attribute-name</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Attribute IDs</string>
|
||||
<key>scope</key>
|
||||
<string>entity.other.attribute-name.id, punctuation.definition.entity</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#04000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Selector</string>
|
||||
<key>scope</key>
|
||||
<string>meta.selector</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Values</string>
|
||||
<key>scope</key>
|
||||
<string>none</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Headings</string>
|
||||
<key>scope</key>
|
||||
<string>markup.heading punctuation.definition.heading, entity.name.section</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#04000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Units</string>
|
||||
<key>scope</key>
|
||||
<string>keyword.other.unit</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Bold</string>
|
||||
<key>scope</key>
|
||||
<string>markup.bold, punctuation.definition.bold</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>bold</string>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Italic</string>
|
||||
<key>scope</key>
|
||||
<string>markup.italic, punctuation.definition.italic</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>italic</string>
|
||||
<key>foreground</key>
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Code</string>
|
||||
<key>scope</key>
|
||||
<string>markup.raw.inline</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#02000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Link Text</string>
|
||||
<key>scope</key>
|
||||
<string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#01000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Link Url</string>
|
||||
<key>scope</key>
|
||||
<string>meta.link</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Quotes</string>
|
||||
<key>scope</key>
|
||||
<string>markup.quote</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Inserted</string>
|
||||
<key>scope</key>
|
||||
<string>markup.inserted</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#02000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Deleted</string>
|
||||
<key>scope</key>
|
||||
<string>markup.deleted</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#01000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Changed</string>
|
||||
<key>scope</key>
|
||||
<string>markup.changed</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Colors</string>
|
||||
<key>scope</key>
|
||||
<string>constant.other.color</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#06000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Regular Expressions</string>
|
||||
<key>scope</key>
|
||||
<string>string.regexp</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#06000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Escape Characters</string>
|
||||
<key>scope</key>
|
||||
<string>constant.character.escape</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#06000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Embedded</string>
|
||||
<key>scope</key>
|
||||
<string>punctuation.section.embedded, variable.interpolation</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Illegal</string>
|
||||
<key>scope</key>
|
||||
<string>invalid.illegal</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#01000000</string>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Broken</string>
|
||||
<key>scope</key>
|
||||
<string>invalid.broken</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#03000000</string>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>uuid</key>
|
||||
<string>uuid</string>
|
||||
</dict>
|
||||
</plist>
|
@ -3,14 +3,14 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!--
|
||||
The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
|
||||
palette number from 00 to 0f, and AA is the special value 00 to indicate
|
||||
that this encoding is being used.
|
||||
The colors in this theme are encoded as #RRGGBBAA where:
|
||||
* If AA is 00, then RR is an ANSI palette number from 00 to 07.
|
||||
* If AA is 01, the terminal's default fg/bg color is used.
|
||||
-->
|
||||
<key>author</key>
|
||||
<string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
|
||||
<key>name</key>
|
||||
<string>ANSI Dark</string>
|
||||
<string>ANSI</string>
|
||||
<key>colorSpaceName</key>
|
||||
<string>sRGB</string>
|
||||
<key>settings</key>
|
||||
@ -19,32 +19,17 @@
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#00000000</string>
|
||||
<key>caret</key>
|
||||
<string>#07000000</string>
|
||||
<string>#00000001</string>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
<key>invisibles</key>
|
||||
<string>#07000000</string>
|
||||
<key>lineHighlight</key>
|
||||
<string>#07000000</string>
|
||||
<key>selection</key>
|
||||
<string>#07000000</string>
|
||||
<string>#00000001</string>
|
||||
<!--
|
||||
Explicitly set the gutter color since bat falls back to a
|
||||
hardcoded DEFAULT_GUTTER_COLOR otherwise.
|
||||
-->
|
||||
<key>gutter</key>
|
||||
<string>#00000000</string>
|
||||
<string>#00000001</string>
|
||||
<key>gutterForeground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Text</string>
|
||||
<key>scope</key>
|
||||
<string>variable.parameter.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
<string>#00000001</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
@ -58,39 +43,6 @@
|
||||
<string>#02000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Punctuation</string>
|
||||
<key>scope</key>
|
||||
<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Delimiters</string>
|
||||
<key>scope</key>
|
||||
<string>none</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Operators</string>
|
||||
<key>scope</key>
|
||||
<string>keyword.operator</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Keywords</string>
|
||||
@ -102,17 +54,6 @@
|
||||
<string>#05000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Variables</string>
|
||||
<key>scope</key>
|
||||
<string>variable</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Functions</string>
|
||||
@ -146,17 +87,6 @@
|
||||
<string>#03000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Classes</string>
|
||||
<key>scope</key>
|
||||
<string>meta.class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Methods</string>
|
||||
@ -480,8 +410,6 @@
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#01000000</string>
|
||||
<key>foreground</key>
|
||||
<string>#07000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
@ -493,8 +421,6 @@
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#03000000</string>
|
||||
<key>foreground</key>
|
||||
<string>#00000000</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
2
assets/themes/dracula-sublime
vendored
2
assets/themes/dracula-sublime
vendored
@ -1 +1 @@
|
||||
Subproject commit 26c57ec282abcaa76e57e055f38432bd827ac34e
|
||||
Subproject commit c2de0acf5af67042393cf70de68013153c043656
|
2
assets/themes/gruvbox
vendored
2
assets/themes/gruvbox
vendored
@ -1 +1 @@
|
||||
Subproject commit e3db74d0e5de7bc09cab76377723ccf6bcc64e8c
|
||||
Subproject commit 64c47250e54298b91e2cf8d401320009aba9f991
|
2
assets/themes/onehalf
vendored
2
assets/themes/onehalf
vendored
@ -1 +1 @@
|
||||
Subproject commit 3aa42a39ed3cddde0c53976a700b81b8a7067890
|
||||
Subproject commit 89923117bc49dd1e0c6b7fdd34bc6dc4d425fe1f
|
2
assets/themes/zenburn
vendored
2
assets/themes/zenburn
vendored
@ -1 +1 @@
|
||||
Subproject commit cb746f69624e635f6f4d127fa9244658e690c34b
|
||||
Subproject commit 7f6fb86e0dcdd06d3c5181ad1cbe94c970834143
|
10
diagnostics/info.sh
vendored
10
diagnostics/info.sh
vendored
@ -58,7 +58,8 @@ _bat_:run() {
|
||||
_out "$BAT" --version
|
||||
_out env | grep '^BAT_\|^PAGER='
|
||||
|
||||
local cache_dir="$($BAT --cache-dir)"
|
||||
local cache_dir
|
||||
cache_dir="$($BAT --cache-dir)"
|
||||
if [[ -f "${cache_dir}/syntaxes.bin" ]]; then
|
||||
_print_command "$BAT" "--list-languages"
|
||||
echo "Found custom syntax set."
|
||||
@ -79,8 +80,8 @@ _bat_config_:run() {
|
||||
_bat_wrapper_:run() {
|
||||
_bat_wrapper_:detect_wrapper() {
|
||||
local bat="$1"
|
||||
if file "$(which "${bat}")" | grep "text executable" &> /dev/null; then
|
||||
_out_fence cat "$(which "${bat}")"
|
||||
if file "$(command -v "${bat}")" | grep "text executable" &> /dev/null; then
|
||||
_out_fence cat "$(command -v "${bat}")"
|
||||
return
|
||||
fi
|
||||
|
||||
@ -104,7 +105,8 @@ _bat_wrapper_function_:run() {
|
||||
fi ;;
|
||||
|
||||
*bash* | *zsh*)
|
||||
local type="$("$SHELL" --login -i -c "type ${command}" 2>&1)"
|
||||
local type
|
||||
type="$("$SHELL" --login -i -c "type ${command}" 2>&1)"
|
||||
if grep 'function' <<< "$type" &> /dev/null; then
|
||||
_out_fence "$SHELL" --login -i -c "declare -f ${command}"
|
||||
return
|
||||
|
@ -191,7 +191,7 @@ ln -s /usr/bin/batcat ~/.local/bin/bat
|
||||
batの最新リリースを実行する場合、または Ubuntu/Debian の古いバージョンを使用している場合は、[release page](https://github.com/sharkdp/bat/releases) から最新の `.deb` パッケージをダウンロードし、
|
||||
次の方法でインストールします:
|
||||
```bash
|
||||
sudo dpkg -i bat_0.16.0_amd64.deb # adapt version number and architecture
|
||||
sudo dpkg -i bat_0.17.1_amd64.deb # adapt version number and architecture
|
||||
```
|
||||
|
||||
### On Alpine Linux
|
||||
|
@ -170,7 +170,7 @@ apt install bat
|
||||
만약 최근 릴리즈된 bat을 사용을 원하거나 buntu/Debian 예전 버전을 사용하는 경우, [릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 다음과 같이 `.deb` 패키지를 받아 설치 할 수도 있습니다:
|
||||
|
||||
```bash
|
||||
sudo dpkg -i bat_0.16.0_amd64.deb # adapt version number and architecture
|
||||
sudo dpkg -i bat_0.17.1_amd64.deb # adapt version number and architecture
|
||||
```
|
||||
|
||||
### On Alpine Linux
|
||||
|
@ -185,7 +185,7 @@ ln -s /usr/bin/batcat ~/.local/bin/bat
|
||||
[release page](https://github.com/sharkdp/bat/releases) и установить так:
|
||||
|
||||
```bash
|
||||
sudo dpkg -i bat_0.16.0_amd64.deb # измените архитектуру и версию
|
||||
sudo dpkg -i bat_0.17.1_amd64.deb # измените архитектуру и версию
|
||||
```
|
||||
|
||||
### Alpine Linux
|
||||
|
97
doc/assets.md
Normal file
97
doc/assets.md
Normal file
@ -0,0 +1,97 @@
|
||||
## Adding new builtin languages for syntax highlighting
|
||||
|
||||
Should you find that a particular syntax is not available within `bat` and think it should be included in `bat` by default, you can follow the instructions outlined below.
|
||||
|
||||
`bat` uses the excellent [syntect](https://github.com/trishume/syntect) library to highlight source
|
||||
code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
|
||||
in the `.sublime-syntax` format.
|
||||
|
||||
**Important:** Before proceeding, verify that the syntax you wish to add meets the [criteria for inclusion](#Criteria-for-inclusion-of-new-syntaxes).
|
||||
|
||||
1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
|
||||
which can be included as a submodule (under `assets/syntaxes`).
|
||||
|
||||
2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
|
||||
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
|
||||
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
|
||||
|
||||
3. Run the `assets/create.sh` script. It calls `bat cache --build` to parse all available
|
||||
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file.
|
||||
|
||||
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
|
||||
`bat` binary.
|
||||
|
||||
5. Use `bat --list-languages` to check if the new languages are available.
|
||||
|
||||
6. Add a syntax test for the new language. See [#Syntax-tests](below) for details.
|
||||
|
||||
7. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
|
||||
file. A new binary cache file will be created once before every new release of `bat`.
|
||||
|
||||
### Syntax tests
|
||||
|
||||
`bat` has a set of syntax highlighting regression tests in `tests/syntax-tests`. The main idea is
|
||||
make sure that we do not run into issues we had in the past where either (1) syntax highlighting
|
||||
for some language is suddenly not working anymore or (2) `bat` suddenly crashes for some input (due
|
||||
to `regex` incompatibilities between `syntect` and Sublime Text).
|
||||
|
||||
In order to add a new test file, please follow these steps (let's take "Ruby" as an example):
|
||||
|
||||
1. Make sure that you are running the **latest version of `bat`** and that `bat` is available on
|
||||
the path. If you are creating a syntax test for a new builtin syntax (see above), make sure that
|
||||
your version of `bat` already has the new syntax builtin.
|
||||
2. Find an example Ruby source file or write one yourself. If possible, the file should aim to be
|
||||
"comprehensive" (i.e. include a lot of the possible syntax), but this is not strictly necessary.
|
||||
A simple file is better than none at all. Also, the files shouldn't be gigantic.
|
||||
3. Save the file in `tests/syntax-tests/source/Ruby` (adapt for your language). The file name could
|
||||
be `test.rb` (adapt extension) but can also be adapted if that is necessary in order for `bat` to
|
||||
highlight it correctly (e.g. `Makefile`).
|
||||
4. If you have copied the file from somewhere else, please make sure that the file *may* be copied
|
||||
under the respective license and that the license is compatible with `bat`s license. If it
|
||||
requires attribution, please add a `LICENSE.md` in the same folder with a text like this:
|
||||
```
|
||||
The `test.rb` file has been added from [enter source here] under the following license:
|
||||
|
||||
[add license text here]
|
||||
```
|
||||
5. Go to `tests/syntax-tests` and run the `update.sh` Bash script. A new file should be generated
|
||||
in the `highlighted` folder (e.g. `highlighted/Ruby/test.rb`).
|
||||
6. Use `cat` or `bat --language=txt` to display the content of this file and make sure that the
|
||||
syntax highlighting looks correct.
|
||||
7. `git add` the new files in the `source` folder as well as the autogenerated files in the
|
||||
`highlighted` folder.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
Make sure that the local cache does not interfere with the internally stored syntaxes and
|
||||
themes (`bat cache --clear`).
|
||||
|
||||
## Criteria for inclusion of new syntaxes
|
||||
|
||||
* More than 10,000 downloads on packagecontrol.io/
|
||||
|
||||
### Manual modifications
|
||||
|
||||
The following files have been manually modified after converting from a `.tmLanguage` file:
|
||||
|
||||
* `Apache.sublime_syntax`=> removed `.conf` and `.CONF` file types.
|
||||
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
||||
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types and support for comments after section headers
|
||||
* `Org mode.sublime-syntax` => removed `task` file type.
|
||||
* `SML.sublime_syntax` => removed `ml` file type.
|
||||
* `Robot.sublime_syntax` => changed name to "Robot Framework", added `.resource` extension
|
||||
|
||||
### Non-submodule additions
|
||||
|
||||
* `Assembly (x86_64)` has been manually added from https://github.com/13xforever/x86-assembly-textmate-bundle due to `git clone` recursion problems
|
||||
* `Nim.sublime-syntax` has been added manually from https://github.com/getzola/zola/blob/master/sublime_syntaxes/Nim.sublime-syntax as there was no suitable Git repository for it. The original syntax seems to originate from https://github.com/Varriount/NimLime
|
||||
* `Rego.sublime-syntax` has been added manually from https://github.com/open-policy-agent/opa/blob/master/misc/syntax/sublime/rego.sublime-syntax
|
||||
as it is not kept in a standalone repository. The file is generated from
|
||||
https://github.com/open-policy-agent/opa/blob/master/misc/syntax/textmate/Rego.tmLanguage
|
||||
* `SML.sublime_syntax` has been added manually from
|
||||
https://github.com/seanjames777/SML-Language-Definitiona as it is not
|
||||
kept in a standalone repository. The file generated is from
|
||||
https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage
|
||||
* `Cabal.sublime_syntax` has been added manually from
|
||||
https://github.com/SublimeHaskell/SublimeHaskell/ - we don't want to include the whole submodule because it includes other syntaxes ("Haskell improved") as well.
|
||||
* `Lean.sublime-syntax` has been added manually from https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json via conversion.
|
@ -45,7 +45,7 @@
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true" />
|
||||
<rect
|
||||
style="opacity:1;fill:#f2f2f2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14294769px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
|
||||
style="opacity:0.5;fill:#e5e5e5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14294769px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
|
||||
id="rect1929"
|
||||
width="1000"
|
||||
height="286.64285"
|
||||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@ -11,6 +11,7 @@ use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder};
|
||||
use path_abs::PathAbs;
|
||||
|
||||
use crate::assets_metadata::AssetsMetadata;
|
||||
use crate::bat_warning;
|
||||
use crate::error::*;
|
||||
use crate::input::{InputReader, OpenedInput, OpenedInputKind};
|
||||
use crate::syntax_mapping::{MappingTarget, SyntaxMapping};
|
||||
@ -37,9 +38,16 @@ impl HighlightingAssets {
|
||||
};
|
||||
|
||||
let theme_dir = source_dir.join("themes");
|
||||
|
||||
let res = theme_set.add_from_folder(&theme_dir);
|
||||
if res.is_err() {
|
||||
if theme_dir.exists() {
|
||||
let res = theme_set.add_from_folder(&theme_dir);
|
||||
if let Err(err) = res {
|
||||
println!(
|
||||
"Failed to load one or more themes from '{}' (reason: '{}')",
|
||||
theme_dir.to_string_lossy(),
|
||||
err,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
println!(
|
||||
"No themes were found in '{}', using the default set",
|
||||
theme_dir.to_string_lossy()
|
||||
@ -189,13 +197,12 @@ impl HighlightingAssets {
|
||||
match self.theme_set.themes.get(theme) {
|
||||
Some(theme) => theme,
|
||||
None => {
|
||||
if theme == "ansi-light" || theme == "ansi-dark" {
|
||||
bat_warning!("Theme '{}' is deprecated, using 'ansi' instead.", theme);
|
||||
return self.get_theme("ansi");
|
||||
}
|
||||
if theme != "" {
|
||||
use ansi_term::Colour::Yellow;
|
||||
eprintln!(
|
||||
"{}: Unknown theme '{}', using default.",
|
||||
Yellow.paint("[bat warning]"),
|
||||
theme
|
||||
);
|
||||
bat_warning!("Unknown theme '{}', using default.", theme)
|
||||
}
|
||||
&self.theme_set.themes[self.fallback_theme.unwrap_or_else(|| Self::default_theme())]
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ use console::Term;
|
||||
use crate::input::{new_file_input, new_stdin_input};
|
||||
use bat::{
|
||||
assets::HighlightingAssets,
|
||||
bat_warning,
|
||||
config::{Config, VisibleLines},
|
||||
error::*,
|
||||
input::Input,
|
||||
@ -82,10 +83,9 @@ impl App {
|
||||
Some("always") => PagingMode::Always,
|
||||
Some("never") => PagingMode::Never,
|
||||
Some("auto") | None => {
|
||||
if self.matches.occurrences_of("plain") > 1 {
|
||||
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
||||
PagingMode::Never
|
||||
} else if self.matches.is_present("no-paging") {
|
||||
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
||||
let extra_plain = self.matches.occurrences_of("plain") > 1;
|
||||
if extra_plain || self.matches.is_present("no-paging") {
|
||||
PagingMode::Never
|
||||
} else if inputs.iter().any(Input::is_stdin) {
|
||||
// If we are reading from stdin, only enable paging if we write to an
|
||||
@ -169,9 +169,8 @@ impl App {
|
||||
|| match self.matches.value_of("color") {
|
||||
Some("always") => true,
|
||||
Some("never") => false,
|
||||
Some("auto") | _ => {
|
||||
env::var_os("NO_COLOR").is_none() && self.interactive_output
|
||||
}
|
||||
Some("auto") => env::var_os("NO_COLOR").is_none() && self.interactive_output,
|
||||
_ => unreachable!("other values for --color are not allowed"),
|
||||
},
|
||||
paging_mode,
|
||||
term_width: maybe_term_width.unwrap_or(Term::stdout().size().1 as usize),
|
||||
@ -226,17 +225,14 @@ impl App {
|
||||
style_components,
|
||||
syntax_mapping,
|
||||
pager: self.matches.value_of("pager"),
|
||||
use_italic_text: match self.matches.value_of("italic-text") {
|
||||
Some("always") => true,
|
||||
_ => false,
|
||||
},
|
||||
use_italic_text: self.matches.value_of("italic-text") == Some("always"),
|
||||
highlighted_lines: self
|
||||
.matches
|
||||
.values_of("highlight-line")
|
||||
.map(|ws| ws.map(LineRange::from).collect())
|
||||
.transpose()?
|
||||
.map(LineRanges::from)
|
||||
.map(|lr| HighlightedLineRanges(lr))
|
||||
.map(HighlightedLineRanges)
|
||||
.unwrap_or_default(),
|
||||
})
|
||||
}
|
||||
@ -288,8 +284,8 @@ impl App {
|
||||
|
||||
fn style_components(&self) -> Result<StyleComponents> {
|
||||
let matches = &self.matches;
|
||||
Ok(StyleComponents(
|
||||
if matches.value_of("decorations") == Some("never") {
|
||||
let mut styled_components =
|
||||
StyleComponents(if matches.value_of("decorations") == Some("never") {
|
||||
HashSet::new()
|
||||
} else if matches.is_present("number") {
|
||||
[StyleComponent::LineNumbers].iter().cloned().collect()
|
||||
@ -323,7 +319,13 @@ impl App {
|
||||
acc.extend(components.iter().cloned());
|
||||
acc
|
||||
})
|
||||
},
|
||||
))
|
||||
});
|
||||
|
||||
// If `grid` is set, remove `rule` as it is a subset of `grid`, and print a warning.
|
||||
if styled_components.grid() && styled_components.0.remove(&StyleComponent::Rule) {
|
||||
bat_warning!("Style 'rule' is a subset of style 'grid', 'rule' will not be visible.");
|
||||
}
|
||||
|
||||
Ok(styled_components)
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
.validator(|val| {
|
||||
let mut invalid_vals = val.split(',').filter(|style| {
|
||||
!&[
|
||||
"auto", "full", "plain", "header", "grid", "numbers", "snip",
|
||||
"auto", "full", "plain", "header", "grid", "rule", "numbers", "snip",
|
||||
#[cfg(feature = "git")]
|
||||
"changes",
|
||||
]
|
||||
@ -382,7 +382,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
})
|
||||
.help(
|
||||
"Comma-separated list of style elements to display \
|
||||
(*auto*, full, plain, changes, header, grid, numbers, snip).",
|
||||
(*auto*, full, plain, changes, header, grid, rule, numbers, snip).",
|
||||
)
|
||||
.long_help(
|
||||
"Configure which elements (line numbers, file headers, grid \
|
||||
@ -400,6 +400,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
* header: show filenames before the content.\n \
|
||||
* grid: vertical/horizontal lines to separate side bar\n \
|
||||
and the header from the content.\n \
|
||||
* rule: horizontal lines to delimit files.\n \
|
||||
* numbers: show line numbers in the side bar.\n \
|
||||
* snip: draw separation lines between distinct line ranges.",
|
||||
),
|
||||
|
@ -44,8 +44,7 @@ pub fn generate_config_file() -> bat::error::Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
let default_config =
|
||||
r#"# This is `bat`s configuration file. Each line either contains a comment or
|
||||
let default_config = r#"# This is `bat`s configuration file. Each line either contains a comment or
|
||||
# a command-line option that you want to pass to `bat` by default. You can
|
||||
# run `bat --help` to get a list of all possible configuration options.
|
||||
|
||||
@ -86,7 +85,7 @@ pub fn get_args_from_config_file() -> Result<Vec<OsString>, shell_words::ParseEr
|
||||
.ok()
|
||||
.map(|content| get_args_from_str(&content))
|
||||
.transpose()?
|
||||
.unwrap_or_else(|| vec![]))
|
||||
.unwrap_or_else(Vec::new))
|
||||
}
|
||||
|
||||
pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
|
||||
|
@ -36,6 +36,7 @@ use bat::{
|
||||
input::Input,
|
||||
style::{StyleComponent, StyleComponents},
|
||||
MappingTarget,
|
||||
PagingMode,
|
||||
};
|
||||
|
||||
const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
|
||||
@ -78,7 +79,9 @@ fn get_syntax_mapping_to_paths<'a>(
|
||||
map
|
||||
}
|
||||
|
||||
pub fn list_languages(config: &Config) -> Result<()> {
|
||||
pub fn get_languages(config: &Config) -> Result<String> {
|
||||
let mut result: String = String::new();
|
||||
|
||||
let assets = assets_from_cache_or_binary()?;
|
||||
let mut languages = assets
|
||||
.syntaxes()
|
||||
@ -119,12 +122,9 @@ pub fn list_languages(config: &Config) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
let stdout = io::stdout();
|
||||
let mut stdout = stdout.lock();
|
||||
|
||||
if config.loop_through {
|
||||
for lang in languages {
|
||||
writeln!(stdout, "{}:{}", lang.name, lang.file_extensions.join(","))?;
|
||||
result += &format!("{}:{}\n", lang.name, lang.file_extensions.join(","));
|
||||
}
|
||||
} else {
|
||||
let longest = languages
|
||||
@ -145,7 +145,7 @@ pub fn list_languages(config: &Config) -> Result<()> {
|
||||
};
|
||||
|
||||
for lang in languages {
|
||||
write!(stdout, "{:width$}{}", lang.name, separator, width = longest)?;
|
||||
result += &format!("{:width$}{}", lang.name, separator, width = longest);
|
||||
|
||||
// Number of characters on this line so far, wrap before `desired_width`
|
||||
let mut num_chars = 0;
|
||||
@ -156,20 +156,20 @@ pub fn list_languages(config: &Config) -> Result<()> {
|
||||
let new_chars = word.len() + comma_separator.len();
|
||||
if num_chars + new_chars >= desired_width {
|
||||
num_chars = 0;
|
||||
write!(stdout, "\n{:width$}{}", "", separator, width = longest)?;
|
||||
result += &format!("\n{:width$}{}", "", separator, width = longest);
|
||||
}
|
||||
|
||||
num_chars += new_chars;
|
||||
write!(stdout, "{}", style.paint(&word[..]))?;
|
||||
result += &format!("{}", style.paint(&word[..]));
|
||||
if extension.peek().is_some() {
|
||||
write!(stdout, "{}", comma_separator)?;
|
||||
result += comma_separator;
|
||||
}
|
||||
}
|
||||
writeln!(stdout)?;
|
||||
result += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
fn theme_preview_file<'a>() -> Input<'a> {
|
||||
@ -200,6 +200,14 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
|
||||
.ok();
|
||||
writeln!(stdout)?;
|
||||
}
|
||||
writeln!(
|
||||
stdout,
|
||||
"Further themes can be installed to '{}', \
|
||||
and are added to the cache with `bat cache --build`. \
|
||||
For more information, see:\n\n \
|
||||
https://github.com/sharkdp/bat#adding-new-themes",
|
||||
config_file().join("themes").to_string_lossy()
|
||||
)?;
|
||||
} else {
|
||||
for theme in assets.themes() {
|
||||
writeln!(stdout, "{}", theme)?;
|
||||
@ -240,8 +248,14 @@ fn run() -> Result<bool> {
|
||||
let config = app.config(&inputs)?;
|
||||
|
||||
if app.matches.is_present("list-languages") {
|
||||
list_languages(&config)?;
|
||||
Ok(true)
|
||||
let languages: String = get_languages(&config)?;
|
||||
let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];
|
||||
let plain_config = Config {
|
||||
style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
|
||||
paging_mode: PagingMode::QuitIfOneScreen,
|
||||
..Default::default()
|
||||
};
|
||||
run_controller(inputs, &plain_config)
|
||||
} else if app.matches.is_present("list-themes") {
|
||||
list_themes(&config)?;
|
||||
Ok(true)
|
||||
|
@ -54,7 +54,10 @@ impl<'b> Controller<'b> {
|
||||
paging_mode = PagingMode::Never;
|
||||
}
|
||||
}
|
||||
output_type = OutputType::from_mode(paging_mode, self.config.pager)?;
|
||||
|
||||
let wrapping_mode = self.config.wrapping_mode;
|
||||
|
||||
output_type = OutputType::from_mode(paging_mode, wrapping_mode, self.config.pager)?;
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "paging"))]
|
||||
@ -144,7 +147,7 @@ impl<'b> Controller<'b> {
|
||||
Ok(no_errors)
|
||||
}
|
||||
|
||||
fn print_file<'a>(
|
||||
fn print_file(
|
||||
&self,
|
||||
printer: &mut dyn Printer,
|
||||
writer: &mut dyn Write,
|
||||
@ -194,6 +197,8 @@ impl<'b> Controller<'b> {
|
||||
let mut first_range: bool = true;
|
||||
let mut mid_range: bool = false;
|
||||
|
||||
let style_snip = self.config.style_components.snip();
|
||||
|
||||
while reader.read_line(&mut line_buffer)? {
|
||||
match line_ranges.check(line_number) {
|
||||
RangeCheckResult::BeforeOrBetweenRanges => {
|
||||
@ -204,7 +209,7 @@ impl<'b> Controller<'b> {
|
||||
}
|
||||
|
||||
RangeCheckResult::InRange => {
|
||||
if self.config.style_components.snip() {
|
||||
if style_snip {
|
||||
if first_range {
|
||||
first_range = false;
|
||||
mid_range = true;
|
||||
|
@ -20,6 +20,10 @@ error_chain! {
|
||||
description("unknown syntax"),
|
||||
display("unknown syntax: '{}'", name)
|
||||
}
|
||||
InvalidPagerValueBat {
|
||||
description("invalid value `bat` for pager property"),
|
||||
display("Use of bat as a pager is disallowed in order to avoid infinite recursion problems")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,9 +143,8 @@ impl<'a> Input<'a> {
|
||||
}
|
||||
|
||||
pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
|
||||
match provided_name {
|
||||
Some(name) => self.description.name = name.to_string_lossy().to_string(),
|
||||
None => {}
|
||||
if let Some(name) = provided_name {
|
||||
self.description.name = name.to_string_lossy().to_string()
|
||||
}
|
||||
|
||||
self.metadata.user_provided_name = provided_name.map(|n| n.to_owned());
|
||||
|
@ -19,6 +19,8 @@
|
||||
//! .unwrap();
|
||||
//! ```
|
||||
|
||||
mod macros;
|
||||
|
||||
pub mod assets;
|
||||
pub mod assets_metadata;
|
||||
pub mod config;
|
||||
|
7
src/macros.rs
Normal file
7
src/macros.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[macro_export]
|
||||
macro_rules! bat_warning {
|
||||
($($arg:tt)*) => ({
|
||||
use ansi_term::Colour::Yellow;
|
||||
eprintln!("{}: {}", Yellow.paint("[bat warning]"), format!($($arg)*));
|
||||
})
|
||||
}
|
@ -7,6 +7,15 @@ use crate::error::*;
|
||||
use crate::less::retrieve_less_version;
|
||||
#[cfg(feature = "paging")]
|
||||
use crate::paging::PagingMode;
|
||||
#[cfg(feature = "paging")]
|
||||
use crate::wrapping::WrappingMode;
|
||||
|
||||
#[cfg(feature = "paging")]
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum SingleScreenAction {
|
||||
Quit,
|
||||
Nothing,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum OutputType {
|
||||
@ -17,18 +26,28 @@ pub enum OutputType {
|
||||
|
||||
impl OutputType {
|
||||
#[cfg(feature = "paging")]
|
||||
pub fn from_mode(mode: PagingMode, pager: Option<&str>) -> Result<Self> {
|
||||
pub fn from_mode(
|
||||
paging_mode: PagingMode,
|
||||
wrapping_mode: WrappingMode,
|
||||
pager: Option<&str>,
|
||||
) -> Result<Self> {
|
||||
use self::PagingMode::*;
|
||||
Ok(match mode {
|
||||
Always => OutputType::try_pager(false, pager)?,
|
||||
QuitIfOneScreen => OutputType::try_pager(true, pager)?,
|
||||
Ok(match paging_mode {
|
||||
Always => OutputType::try_pager(SingleScreenAction::Nothing, wrapping_mode, pager)?,
|
||||
QuitIfOneScreen => {
|
||||
OutputType::try_pager(SingleScreenAction::Quit, wrapping_mode, pager)?
|
||||
}
|
||||
_ => OutputType::stdout(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Try to launch the pager. Fall back to stdout in case of errors.
|
||||
#[cfg(feature = "paging")]
|
||||
fn try_pager(quit_if_one_screen: bool, pager_from_config: Option<&str>) -> Result<Self> {
|
||||
fn try_pager(
|
||||
single_screen_action: SingleScreenAction,
|
||||
wrapping_mode: WrappingMode,
|
||||
pager_from_config: Option<&str>,
|
||||
) -> Result<Self> {
|
||||
use std::env;
|
||||
use std::ffi::OsString;
|
||||
use std::path::PathBuf;
|
||||
@ -66,10 +85,10 @@ impl OutputType {
|
||||
|
||||
match pagerflags.split_first() {
|
||||
Some((pager_name, args)) => {
|
||||
let mut pager_path = PathBuf::from(pager_name);
|
||||
let pager_path = PathBuf::from(pager_name);
|
||||
|
||||
if pager_path.file_stem() == Some(&OsString::from("bat")) {
|
||||
pager_path = PathBuf::from("less");
|
||||
return Err(ErrorKind::InvalidPagerValueBat.into());
|
||||
}
|
||||
|
||||
let is_less = pager_path.file_stem() == Some(&OsString::from("less"));
|
||||
@ -78,10 +97,14 @@ impl OutputType {
|
||||
let mut p = Command::new(&pager_path);
|
||||
if args.is_empty() || replace_arguments_to_less {
|
||||
p.arg("--RAW-CONTROL-CHARS");
|
||||
if quit_if_one_screen {
|
||||
if single_screen_action == SingleScreenAction::Quit {
|
||||
p.arg("--quit-if-one-screen");
|
||||
}
|
||||
|
||||
if wrapping_mode == WrappingMode::NoWrapping {
|
||||
p.arg("--chop-long-lines");
|
||||
}
|
||||
|
||||
// Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
|
||||
// versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
|
||||
//
|
||||
|
@ -72,7 +72,7 @@ pub fn replace_nonprintable(input: &[u8], tab_width: usize) -> String {
|
||||
}
|
||||
}
|
||||
// line feed
|
||||
'\x0A' => output.push('␊'),
|
||||
'\x0A' => output.push_str("␊\x0A"),
|
||||
// carriage return
|
||||
'\x0D' => output.push('␍'),
|
||||
// null
|
||||
|
@ -23,6 +23,7 @@ struct ActiveStyleComponents {
|
||||
header: bool,
|
||||
vcs_modification_markers: bool,
|
||||
grid: bool,
|
||||
rule: bool,
|
||||
line_numbers: bool,
|
||||
snip: bool,
|
||||
}
|
||||
@ -179,6 +180,12 @@ impl<'a> PrettyPrinter<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Whether to paint a horizontal rule to delimit files
|
||||
pub fn rule(&mut self, yes: bool) -> &mut Self {
|
||||
self.active_style_components.rule = yes;
|
||||
self
|
||||
}
|
||||
|
||||
/// Whether to show modification markers for VCS changes. This has no effect if
|
||||
/// the `git` feature is not activated.
|
||||
#[cfg_attr(
|
||||
@ -285,6 +292,9 @@ impl<'a> PrettyPrinter<'a> {
|
||||
if self.active_style_components.grid {
|
||||
style_components.push(StyleComponent::Grid);
|
||||
}
|
||||
if self.active_style_components.rule {
|
||||
style_components.push(StyleComponent::Rule);
|
||||
}
|
||||
if self.active_style_components.header {
|
||||
style_components.push(StyleComponent::Header);
|
||||
}
|
||||
@ -328,7 +338,7 @@ impl<'a> Input<'a> {
|
||||
|
||||
/// A new input from bytes.
|
||||
pub fn from_bytes(bytes: &'a [u8]) -> Self {
|
||||
Input::from_reader(bytes).into()
|
||||
Input::from_reader(bytes)
|
||||
}
|
||||
|
||||
/// A new input from STDIN.
|
||||
|
@ -91,9 +91,6 @@ impl<'a> Printer for SimplePrinter<'a> {
|
||||
if self.config.show_nonprintable {
|
||||
let line = replace_nonprintable(line_buffer, self.config.tab_width);
|
||||
write!(handle, "{}", line)?;
|
||||
if line_buffer.last() == Some(&b'\n') {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
} else {
|
||||
handle.write_all(line_buffer)?
|
||||
};
|
||||
@ -200,13 +197,18 @@ impl<'a> InteractivePrinter<'a> {
|
||||
})
|
||||
}
|
||||
|
||||
fn print_horizontal_line_term(&mut self, handle: &mut dyn Write, style: Style) -> Result<()> {
|
||||
writeln!(
|
||||
handle,
|
||||
"{}",
|
||||
style.paint("─".repeat(self.config.term_width))
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn print_horizontal_line(&mut self, handle: &mut dyn Write, grid_char: char) -> Result<()> {
|
||||
if self.panel_width == 0 {
|
||||
writeln!(
|
||||
handle,
|
||||
"{}",
|
||||
self.colors.grid.paint("─".repeat(self.config.term_width))
|
||||
)?;
|
||||
self.print_horizontal_line_term(handle, self.colors.grid)?;
|
||||
} else {
|
||||
let hline = "─".repeat(self.config.term_width - (self.panel_width + 1));
|
||||
let hline = format!("{}{}{}", "─".repeat(self.panel_width), grid_char, hline);
|
||||
@ -251,6 +253,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
input: &OpenedInput,
|
||||
add_header_padding: bool,
|
||||
) -> Result<()> {
|
||||
if add_header_padding && self.config.style_components.rule() {
|
||||
self.print_horizontal_line_term(handle, self.colors.rule)?;
|
||||
}
|
||||
|
||||
if !self.config.style_components.header() {
|
||||
if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
|
||||
writeln!(
|
||||
@ -279,7 +285,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
.paint(if self.panel_width > 0 { "│ " } else { "" }),
|
||||
)?;
|
||||
} else {
|
||||
if add_header_padding {
|
||||
// Only pad space between files, if we haven't already drawn a horizontal rule
|
||||
if add_header_padding && !self.config.style_components.rule() {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
write!(handle, "{}", " ".repeat(self.panel_width))?;
|
||||
@ -301,7 +308,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
description
|
||||
.kind()
|
||||
.map(|kind| format!("{}: ", kind))
|
||||
.unwrap_or("".into()),
|
||||
.unwrap_or_else(|| "".into()),
|
||||
self.colors.filename.paint(description.title()),
|
||||
mode
|
||||
)?;
|
||||
@ -441,7 +448,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
if text.len() != text_trimmed.len() {
|
||||
if let Some(background_color) = background_color {
|
||||
let mut ansi_style = Style::default();
|
||||
ansi_style.background = Some(to_ansi_color(background_color, true_color));
|
||||
ansi_style.background = to_ansi_color(background_color, true_color);
|
||||
let width = if cursor_total <= cursor_max {
|
||||
cursor_max - cursor_total + 1
|
||||
} else {
|
||||
@ -453,7 +460,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
if line.bytes().next_back() != Some(b'\n') {
|
||||
if !self.config.style_components.plain() && line.bytes().next_back() != Some(b'\n') {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
} else {
|
||||
@ -582,8 +589,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
|
||||
if let Some(background_color) = background_color {
|
||||
let mut ansi_style = Style::default();
|
||||
ansi_style.background =
|
||||
Some(to_ansi_color(background_color, self.config.true_color));
|
||||
ansi_style.background = to_ansi_color(background_color, self.config.true_color);
|
||||
|
||||
write!(
|
||||
handle,
|
||||
@ -603,6 +609,7 @@ const DEFAULT_GUTTER_COLOR: u8 = 238;
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Colors {
|
||||
pub grid: Style,
|
||||
pub rule: Style,
|
||||
pub filename: Style,
|
||||
pub git_added: Style,
|
||||
pub git_removed: Style,
|
||||
@ -616,19 +623,27 @@ impl Colors {
|
||||
}
|
||||
|
||||
fn colored(theme: &Theme, true_color: bool) -> Self {
|
||||
let gutter_color = theme
|
||||
.settings
|
||||
.gutter_foreground
|
||||
.map(|c| to_ansi_color(c, true_color))
|
||||
.unwrap_or(Fixed(DEFAULT_GUTTER_COLOR));
|
||||
let gutter_style = Style {
|
||||
foreground: match theme.settings.gutter_foreground {
|
||||
// If the theme provides a gutter foreground color, use it.
|
||||
// Note: It might be the special value #00000001, in which case
|
||||
// to_ansi_color returns None and we use an empty Style
|
||||
// (resulting in the terminal's default foreground color).
|
||||
Some(c) => to_ansi_color(c, true_color),
|
||||
// Otherwise, use a specific fallback color.
|
||||
None => Some(Fixed(DEFAULT_GUTTER_COLOR)),
|
||||
},
|
||||
..Style::default()
|
||||
};
|
||||
|
||||
Colors {
|
||||
grid: gutter_color.normal(),
|
||||
grid: gutter_style,
|
||||
rule: gutter_style,
|
||||
filename: Style::new().bold(),
|
||||
git_added: Green.normal(),
|
||||
git_removed: Red.normal(),
|
||||
git_modified: Yellow.normal(),
|
||||
line_number: gutter_color.normal(),
|
||||
line_number: gutter_style,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ pub enum StyleComponent {
|
||||
#[cfg(feature = "git")]
|
||||
Changes,
|
||||
Grid,
|
||||
Rule,
|
||||
Header,
|
||||
LineNumbers,
|
||||
Snip,
|
||||
@ -29,6 +30,7 @@ impl StyleComponent {
|
||||
#[cfg(feature = "git")]
|
||||
StyleComponent::Changes => &[StyleComponent::Changes],
|
||||
StyleComponent::Grid => &[StyleComponent::Grid],
|
||||
StyleComponent::Rule => &[StyleComponent::Rule],
|
||||
StyleComponent::Header => &[StyleComponent::Header],
|
||||
StyleComponent::LineNumbers => &[StyleComponent::LineNumbers],
|
||||
StyleComponent::Snip => &[StyleComponent::Snip],
|
||||
@ -54,6 +56,7 @@ impl FromStr for StyleComponent {
|
||||
#[cfg(feature = "git")]
|
||||
"changes" => Ok(StyleComponent::Changes),
|
||||
"grid" => Ok(StyleComponent::Grid),
|
||||
"rule" => Ok(StyleComponent::Rule),
|
||||
"header" => Ok(StyleComponent::Header),
|
||||
"numbers" => Ok(StyleComponent::LineNumbers),
|
||||
"snip" => Ok(StyleComponent::Snip),
|
||||
@ -81,6 +84,10 @@ impl StyleComponents {
|
||||
self.0.contains(&StyleComponent::Grid)
|
||||
}
|
||||
|
||||
pub fn rule(&self) -> bool {
|
||||
self.0.contains(&StyleComponent::Rule)
|
||||
}
|
||||
|
||||
pub fn header(&self) -> bool {
|
||||
self.0.contains(&StyleComponent::Header)
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ use ansi_term::{self, Style};
|
||||
|
||||
use syntect::highlighting::{self, FontStyle};
|
||||
|
||||
pub fn to_ansi_color(color: highlighting::Color, true_color: bool) -> ansi_term::Color {
|
||||
pub fn to_ansi_color(color: highlighting::Color, true_color: bool) -> Option<ansi_term::Color> {
|
||||
if color.a == 0 {
|
||||
// Themes can specify one of the user-configurable terminal colors by
|
||||
// encoding them as #RRGGBBAA with AA set to 00 (transparent) and RR set
|
||||
// to the 8-bit color palette number. The built-in themes ansi-light,
|
||||
// ansi-dark, base16, and base16-256 use this.
|
||||
match color.r {
|
||||
// to the 8-bit color palette number. The built-in themes ansi, base16,
|
||||
// and base16-256 use this.
|
||||
Some(match color.r {
|
||||
// For the first 8 colors, use the Color enum to produce ANSI escape
|
||||
// sequences using codes 30-37 (foreground) and 40-47 (background).
|
||||
// For example, red foreground is \x1b[31m. This works on terminals
|
||||
@ -31,11 +31,18 @@ pub fn to_ansi_color(color: highlighting::Color, true_color: bool) -> ansi_term:
|
||||
// 90-97 (foreground) and 100-107 (background), we should use those
|
||||
// for values 0x08 to 0x0f and only use Fixed for 0x10 to 0xff.
|
||||
n => Fixed(n),
|
||||
}
|
||||
})
|
||||
} else if color.a == 1 {
|
||||
// Themes can specify the terminal's default foreground/background color
|
||||
// (i.e. no escape sequence) using the encoding #RRGGBBAA with AA set to
|
||||
// 01. The built-in theme ansi uses this.
|
||||
None
|
||||
} else if true_color {
|
||||
RGB(color.r, color.g, color.b)
|
||||
Some(RGB(color.r, color.g, color.b))
|
||||
} else {
|
||||
Fixed(ansi_colours::ansi256_from_rgb((color.r, color.g, color.b)))
|
||||
Some(Fixed(ansi_colours::ansi256_from_rgb((
|
||||
color.r, color.g, color.b,
|
||||
))))
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +61,10 @@ pub fn as_terminal_escaped(
|
||||
let mut style = if !colored {
|
||||
Style::default()
|
||||
} else {
|
||||
let mut color = Style::from(to_ansi_color(style.foreground, true_color));
|
||||
let mut color = Style {
|
||||
foreground: to_ansi_color(style.foreground, true_color),
|
||||
..Style::default()
|
||||
};
|
||||
if style.font_style.contains(FontStyle::BOLD) {
|
||||
color = color.bold();
|
||||
}
|
||||
@ -67,6 +77,6 @@ pub fn as_terminal_escaped(
|
||||
color
|
||||
};
|
||||
|
||||
style.background = background_color.map(|c| to_ansi_color(c, true_color));
|
||||
style.background = background_color.and_then(|c| to_ansi_color(c, true_color));
|
||||
style.paint(text).to_string()
|
||||
}
|
||||
|
4
tests/.gitattributes
vendored
4
tests/.gitattributes
vendored
@ -4,10 +4,6 @@ snapshots/** text=auto eol=lf
|
||||
syntax-tests/source/** text=auto eol=lf
|
||||
syntax-tests/highlighted/** text=auto eol=lf
|
||||
|
||||
# BAT/CMD files always need CRLF EOLs
|
||||
*.[Bb][Aa][Tt] text eol=crlf
|
||||
*.[Cc][Mm][Dd] text eol=crlf
|
||||
|
||||
examples/* linguist-vendored
|
||||
snapshots/* linguist-vendored
|
||||
benchmarks/* linguist-vendored
|
||||
|
@ -1,7 +1,9 @@
|
||||
use bat::assets::HighlightingAssets;
|
||||
|
||||
/// This test ensures that we are not accidentally removing themes due to submodule updates.
|
||||
/// It is 'ignore'd by default because it requires themes.bin to be up-to-date.
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn all_themes_are_present() {
|
||||
let assets = HighlightingAssets::from_binary();
|
||||
|
||||
@ -12,6 +14,8 @@ fn all_themes_are_present() {
|
||||
themes,
|
||||
vec![
|
||||
"1337",
|
||||
"Coldark-Cold",
|
||||
"Coldark-Dark",
|
||||
"DarkNeon",
|
||||
"Dracula",
|
||||
"GitHub",
|
||||
@ -26,13 +30,11 @@ fn all_themes_are_present() {
|
||||
"Solarized (light)",
|
||||
"Sublime Snazzy",
|
||||
"TwoDark",
|
||||
"ansi-dark",
|
||||
"ansi-light",
|
||||
"ansi",
|
||||
"base16",
|
||||
"base16-256",
|
||||
"gruvbox",
|
||||
"gruvbox-dark",
|
||||
"gruvbox-light",
|
||||
"gruvbox-white",
|
||||
"zenburn"
|
||||
]
|
||||
);
|
||||
|
4
tests/benchmarks/comparison.sh
vendored
4
tests/benchmarks/comparison.sh
vendored
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
||||
|
||||
if ! which hyperfine > /dev/null 2>&1; then
|
||||
if ! command -v hyperfine > /dev/null 2>&1; then
|
||||
echo "'hyperfine' does not seem to be installed."
|
||||
echo "You can get it here: https://github.com/sharkdp/hyperfine"
|
||||
exit 1
|
||||
|
8
tests/benchmarks/run-benchmarks.sh
vendored
8
tests/benchmarks/run-benchmarks.sh
vendored
@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
||||
|
||||
# Check that Hyperfine is installed.
|
||||
if ! which hyperfine > /dev/null 2>&1; then
|
||||
echo "'hyperfine' does not seem to be installed." 1>&2
|
||||
echo "You can get it here: https://github.com/sharkdp/hyperfine" 1>&2
|
||||
if ! command -v hyperfine > /dev/null 2>&1; then
|
||||
echo "'hyperfine' does not seem to be installed."
|
||||
echo "You can get it here: https://github.com/sharkdp/hyperfine"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -405,6 +405,16 @@ fn pager_disable() {
|
||||
.stdout(predicate::eq("hello world\n").normalize());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pager_value_bat() {
|
||||
bat()
|
||||
.arg("--pager=bat")
|
||||
.arg("--paging=always")
|
||||
.arg("test.txt")
|
||||
.assert()
|
||||
.failure();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn alias_pager_disable() {
|
||||
bat()
|
||||
@ -570,6 +580,18 @@ fn empty_file_leads_to_empty_output_with_grid_enabled() {
|
||||
.stdout("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty_file_leads_to_empty_output_with_rule_enabled() {
|
||||
bat()
|
||||
.arg("empty.txt")
|
||||
.arg("--style=rule")
|
||||
.arg("--decorations=always")
|
||||
.arg("--terminal-width=80")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn filename_basic() {
|
||||
bat()
|
||||
@ -668,6 +690,48 @@ fn header_padding() {
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn header_padding_rule() {
|
||||
bat()
|
||||
.arg("--decorations=always")
|
||||
.arg("--style=header,rule")
|
||||
.arg("--terminal-width=80")
|
||||
.arg("test.txt")
|
||||
.arg("single-line.txt")
|
||||
.assert()
|
||||
.stdout(
|
||||
"File: test.txt
|
||||
hello world
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
File: single-line.txt
|
||||
Single Line
|
||||
",
|
||||
)
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn grid_overrides_rule() {
|
||||
bat()
|
||||
.arg("--decorations=always")
|
||||
.arg("--style=grid,rule")
|
||||
.arg("--terminal-width=80")
|
||||
.arg("test.txt")
|
||||
.arg("single-line.txt")
|
||||
.assert()
|
||||
.stdout(
|
||||
"\
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
hello world
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
Single Line
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
",
|
||||
)
|
||||
.stderr("\x1b[33m[bat warning]\x1b[0m: Style 'rule' is a subset of style 'grid', 'rule' will not be visible.\n");
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn file_with_invalid_utf8_filename() {
|
||||
@ -749,3 +813,41 @@ fn show_all_mode() {
|
||||
.stdout("hello·world␊\n├──┤␍␀␇␈␛")
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plain_mode_does_not_add_nonexisting_newline() {
|
||||
bat()
|
||||
.arg("--paging=never")
|
||||
.arg("--color=never")
|
||||
.arg("--decorations=always")
|
||||
.arg("--style=plain")
|
||||
.arg("single-line.txt")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("Single Line");
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/sharkdp/bat/issues/299
|
||||
#[test]
|
||||
fn grid_for_file_without_newline() {
|
||||
bat()
|
||||
.arg("--paging=never")
|
||||
.arg("--color=never")
|
||||
.arg("--terminal-width=80")
|
||||
.arg("--wrap=never")
|
||||
.arg("--decorations=always")
|
||||
.arg("--style=full")
|
||||
.arg("single-line.txt")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(
|
||||
"\
|
||||
───────┬────────────────────────────────────────────────────────────────────────
|
||||
│ File: single-line.txt
|
||||
───────┼────────────────────────────────────────────────────────────────────────
|
||||
1 │ Single Line
|
||||
───────┴────────────────────────────────────────────────────────────────────────
|
||||
",
|
||||
)
|
||||
.stderr("");
|
||||
}
|
||||
|
@ -19,17 +19,27 @@ snapshot_tests! {
|
||||
grid: "grid",
|
||||
header: "header",
|
||||
numbers: "numbers",
|
||||
rule: "rule",
|
||||
changes_grid: "changes,grid",
|
||||
changes_header: "changes,header",
|
||||
changes_numbers: "changes,numbers",
|
||||
changes_rule: "changes,rule",
|
||||
grid_header: "grid,header",
|
||||
grid_numbers: "grid,numbers",
|
||||
grid_rule: "grid,rule",
|
||||
header_numbers: "header,numbers",
|
||||
header_rule: "header,rule",
|
||||
changes_grid_header: "changes,grid,header",
|
||||
changes_grid_numbers: "changes,grid,numbers",
|
||||
changes_grid_rule: "changes,grid,rule",
|
||||
changes_header_numbers: "changes,header,numbers",
|
||||
changes_header_rule: "changes,header,rule",
|
||||
grid_header_numbers: "grid,header,numbers",
|
||||
grid_header_rule: "grid,header,rule",
|
||||
header_numbers_rule: "header,numbers,rule",
|
||||
changes_grid_header_numbers: "changes,grid,header,numbers",
|
||||
changes_grid_header_rule: "changes,grid,header,rule",
|
||||
changes_grid_header_numbers_rule: "changes,grid,header,numbers,rule",
|
||||
full: "full",
|
||||
plain: "plain",
|
||||
}
|
||||
|
2
tests/snapshots/generate_snapshots.py
vendored
2
tests/snapshots/generate_snapshots.py
vendored
@ -7,7 +7,7 @@ import shutil
|
||||
|
||||
|
||||
def generate_snapshots():
|
||||
single_styles = ["changes", "grid", "header", "numbers"]
|
||||
single_styles = ["changes", "grid", "header", "numbers", "rule"]
|
||||
collective_styles = ["full", "plain"]
|
||||
|
||||
for num in range(len(single_styles)):
|
||||
|
@ -0,0 +1,26 @@
|
||||
───────┬────────────────────────────────────────────────────────────────────────
|
||||
│ File: sample.rs
|
||||
───────┼────────────────────────────────────────────────────────────────────────
|
||||
1 │ struct Rectangle {
|
||||
2 │ width: u32,
|
||||
3 │ height: u32,
|
||||
4 │ }
|
||||
5 │
|
||||
6 _ │ fn main() {
|
||||
7 │ let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8 │
|
||||
9 │ println!(
|
||||
10 ~ │ "The perimeter of the rectangle is {} pixels.",
|
||||
11 ~ │ perimeter(&rect1)
|
||||
12 │ );
|
||||
13 + │ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 │ }
|
||||
15 │
|
||||
16 │ fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 │ rectangle.width * rectangle.height
|
||||
18 │ }
|
||||
19 + │
|
||||
20 + │ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 + │ (rectangle.width + rectangle.height) * 2
|
||||
22 + │ }
|
||||
───────┴────────────────────────────────────────────────────────────────────────
|
26
tests/snapshots/output/changes_grid_header_rule.snapshot.txt
Normal file
26
tests/snapshots/output/changes_grid_header_rule.snapshot.txt
Normal file
@ -0,0 +1,26 @@
|
||||
──┬─────────────────────────────────────────────────────────────────────────────
|
||||
│ File: sample.rs
|
||||
──┼─────────────────────────────────────────────────────────────────────────────
|
||||
│ struct Rectangle {
|
||||
│ width: u32,
|
||||
│ height: u32,
|
||||
│ }
|
||||
│
|
||||
_ │ fn main() {
|
||||
│ let rect1 = Rectangle { width: 30, height: 50 };
|
||||
│
|
||||
│ println!(
|
||||
~ │ "The perimeter of the rectangle is {} pixels.",
|
||||
~ │ perimeter(&rect1)
|
||||
│ );
|
||||
+ │ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
│ }
|
||||
│
|
||||
│ fn area(rectangle: &Rectangle) -> u32 {
|
||||
│ rectangle.width * rectangle.height
|
||||
│ }
|
||||
+ │
|
||||
+ │ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
+ │ (rectangle.width + rectangle.height) * 2
|
||||
+ │ }
|
||||
──┴─────────────────────────────────────────────────────────────────────────────
|
@ -0,0 +1,24 @@
|
||||
───────┬────────────────────────────────────────────────────────────────────────
|
||||
1 │ struct Rectangle {
|
||||
2 │ width: u32,
|
||||
3 │ height: u32,
|
||||
4 │ }
|
||||
5 │
|
||||
6 _ │ fn main() {
|
||||
7 │ let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8 │
|
||||
9 │ println!(
|
||||
10 ~ │ "The perimeter of the rectangle is {} pixels.",
|
||||
11 ~ │ perimeter(&rect1)
|
||||
12 │ );
|
||||
13 + │ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 │ }
|
||||
15 │
|
||||
16 │ fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 │ rectangle.width * rectangle.height
|
||||
18 │ }
|
||||
19 + │
|
||||
20 + │ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 + │ (rectangle.width + rectangle.height) * 2
|
||||
22 + │ }
|
||||
───────┴────────────────────────────────────────────────────────────────────────
|
24
tests/snapshots/output/changes_grid_rule.snapshot.txt
Normal file
24
tests/snapshots/output/changes_grid_rule.snapshot.txt
Normal file
@ -0,0 +1,24 @@
|
||||
──┬─────────────────────────────────────────────────────────────────────────────
|
||||
│ struct Rectangle {
|
||||
│ width: u32,
|
||||
│ height: u32,
|
||||
│ }
|
||||
│
|
||||
_ │ fn main() {
|
||||
│ let rect1 = Rectangle { width: 30, height: 50 };
|
||||
│
|
||||
│ println!(
|
||||
~ │ "The perimeter of the rectangle is {} pixels.",
|
||||
~ │ perimeter(&rect1)
|
||||
│ );
|
||||
+ │ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
│ }
|
||||
│
|
||||
│ fn area(rectangle: &Rectangle) -> u32 {
|
||||
│ rectangle.width * rectangle.height
|
||||
│ }
|
||||
+ │
|
||||
+ │ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
+ │ (rectangle.width + rectangle.height) * 2
|
||||
+ │ }
|
||||
──┴─────────────────────────────────────────────────────────────────────────────
|
@ -0,0 +1,23 @@
|
||||
File: sample.rs
|
||||
1 struct Rectangle {
|
||||
2 width: u32,
|
||||
3 height: u32,
|
||||
4 }
|
||||
5
|
||||
6 _ fn main() {
|
||||
7 let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8
|
||||
9 println!(
|
||||
10 ~ "The perimeter of the rectangle is {} pixels.",
|
||||
11 ~ perimeter(&rect1)
|
||||
12 );
|
||||
13 + println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 }
|
||||
15
|
||||
16 fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 rectangle.width * rectangle.height
|
||||
18 }
|
||||
19 +
|
||||
20 + fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 + (rectangle.width + rectangle.height) * 2
|
||||
22 + }
|
23
tests/snapshots/output/changes_header_rule.snapshot.txt
Normal file
23
tests/snapshots/output/changes_header_rule.snapshot.txt
Normal file
@ -0,0 +1,23 @@
|
||||
File: sample.rs
|
||||
struct Rectangle {
|
||||
width: u32,
|
||||
height: u32,
|
||||
}
|
||||
|
||||
_ fn main() {
|
||||
let rect1 = Rectangle { width: 30, height: 50 };
|
||||
|
||||
println!(
|
||||
~ "The perimeter of the rectangle is {} pixels.",
|
||||
~ perimeter(&rect1)
|
||||
);
|
||||
+ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
}
|
||||
|
||||
fn area(rectangle: &Rectangle) -> u32 {
|
||||
rectangle.width * rectangle.height
|
||||
}
|
||||
+
|
||||
+ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
+ (rectangle.width + rectangle.height) * 2
|
||||
+ }
|
22
tests/snapshots/output/changes_numbers_rule.snapshot.txt
Normal file
22
tests/snapshots/output/changes_numbers_rule.snapshot.txt
Normal file
@ -0,0 +1,22 @@
|
||||
1 struct Rectangle {
|
||||
2 width: u32,
|
||||
3 height: u32,
|
||||
4 }
|
||||
5
|
||||
6 _ fn main() {
|
||||
7 let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8
|
||||
9 println!(
|
||||
10 ~ "The perimeter of the rectangle is {} pixels.",
|
||||
11 ~ perimeter(&rect1)
|
||||
12 );
|
||||
13 + println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 }
|
||||
15
|
||||
16 fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 rectangle.width * rectangle.height
|
||||
18 }
|
||||
19 +
|
||||
20 + fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 + (rectangle.width + rectangle.height) * 2
|
||||
22 + }
|
22
tests/snapshots/output/changes_rule.snapshot.txt
Normal file
22
tests/snapshots/output/changes_rule.snapshot.txt
Normal file
@ -0,0 +1,22 @@
|
||||
struct Rectangle {
|
||||
width: u32,
|
||||
height: u32,
|
||||
}
|
||||
|
||||
_ fn main() {
|
||||
let rect1 = Rectangle { width: 30, height: 50 };
|
||||
|
||||
println!(
|
||||
~ "The perimeter of the rectangle is {} pixels.",
|
||||
~ perimeter(&rect1)
|
||||
);
|
||||
+ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
}
|
||||
|
||||
fn area(rectangle: &Rectangle) -> u32 {
|
||||
rectangle.width * rectangle.height
|
||||
}
|
||||
+
|
||||
+ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
+ (rectangle.width + rectangle.height) * 2
|
||||
+ }
|
26
tests/snapshots/output/grid_header_numbers_rule.snapshot.txt
Normal file
26
tests/snapshots/output/grid_header_numbers_rule.snapshot.txt
Normal file
@ -0,0 +1,26 @@
|
||||
─────┬──────────────────────────────────────────────────────────────────────────
|
||||
│ File: sample.rs
|
||||
─────┼──────────────────────────────────────────────────────────────────────────
|
||||
1 │ struct Rectangle {
|
||||
2 │ width: u32,
|
||||
3 │ height: u32,
|
||||
4 │ }
|
||||
5 │
|
||||
6 │ fn main() {
|
||||
7 │ let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8 │
|
||||
9 │ println!(
|
||||
10 │ "The perimeter of the rectangle is {} pixels.",
|
||||
11 │ perimeter(&rect1)
|
||||
12 │ );
|
||||
13 │ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 │ }
|
||||
15 │
|
||||
16 │ fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 │ rectangle.width * rectangle.height
|
||||
18 │ }
|
||||
19 │
|
||||
20 │ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 │ (rectangle.width + rectangle.height) * 2
|
||||
22 │ }
|
||||
─────┴──────────────────────────────────────────────────────────────────────────
|
26
tests/snapshots/output/grid_header_rule.snapshot.txt
Normal file
26
tests/snapshots/output/grid_header_rule.snapshot.txt
Normal file
@ -0,0 +1,26 @@
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
File: sample.rs
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
struct Rectangle {
|
||||
width: u32,
|
||||
height: u32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let rect1 = Rectangle { width: 30, height: 50 };
|
||||
|
||||
println!(
|
||||
"The perimeter of the rectangle is {} pixels.",
|
||||
perimeter(&rect1)
|
||||
);
|
||||
println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
}
|
||||
|
||||
fn area(rectangle: &Rectangle) -> u32 {
|
||||
rectangle.width * rectangle.height
|
||||
}
|
||||
|
||||
fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
(rectangle.width + rectangle.height) * 2
|
||||
}
|
||||
────────────────────────────────────────────────────────────────────────────────
|
24
tests/snapshots/output/grid_numbers_rule.snapshot.txt
Normal file
24
tests/snapshots/output/grid_numbers_rule.snapshot.txt
Normal file
@ -0,0 +1,24 @@
|
||||
─────┬──────────────────────────────────────────────────────────────────────────
|
||||
1 │ struct Rectangle {
|
||||
2 │ width: u32,
|
||||
3 │ height: u32,
|
||||
4 │ }
|
||||
5 │
|
||||
6 │ fn main() {
|
||||
7 │ let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8 │
|
||||
9 │ println!(
|
||||
10 │ "The perimeter of the rectangle is {} pixels.",
|
||||
11 │ perimeter(&rect1)
|
||||
12 │ );
|
||||
13 │ println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 │ }
|
||||
15 │
|
||||
16 │ fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 │ rectangle.width * rectangle.height
|
||||
18 │ }
|
||||
19 │
|
||||
20 │ fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 │ (rectangle.width + rectangle.height) * 2
|
||||
22 │ }
|
||||
─────┴──────────────────────────────────────────────────────────────────────────
|
24
tests/snapshots/output/grid_rule.snapshot.txt
Normal file
24
tests/snapshots/output/grid_rule.snapshot.txt
Normal file
@ -0,0 +1,24 @@
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
struct Rectangle {
|
||||
width: u32,
|
||||
height: u32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let rect1 = Rectangle { width: 30, height: 50 };
|
||||
|
||||
println!(
|
||||
"The perimeter of the rectangle is {} pixels.",
|
||||
perimeter(&rect1)
|
||||
);
|
||||
println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
}
|
||||
|
||||
fn area(rectangle: &Rectangle) -> u32 {
|
||||
rectangle.width * rectangle.height
|
||||
}
|
||||
|
||||
fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
(rectangle.width + rectangle.height) * 2
|
||||
}
|
||||
────────────────────────────────────────────────────────────────────────────────
|
23
tests/snapshots/output/header_numbers_rule.snapshot.txt
Normal file
23
tests/snapshots/output/header_numbers_rule.snapshot.txt
Normal file
@ -0,0 +1,23 @@
|
||||
File: sample.rs
|
||||
1 struct Rectangle {
|
||||
2 width: u32,
|
||||
3 height: u32,
|
||||
4 }
|
||||
5
|
||||
6 fn main() {
|
||||
7 let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8
|
||||
9 println!(
|
||||
10 "The perimeter of the rectangle is {} pixels.",
|
||||
11 perimeter(&rect1)
|
||||
12 );
|
||||
13 println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 }
|
||||
15
|
||||
16 fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 rectangle.width * rectangle.height
|
||||
18 }
|
||||
19
|
||||
20 fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 (rectangle.width + rectangle.height) * 2
|
||||
22 }
|
23
tests/snapshots/output/header_rule.snapshot.txt
Normal file
23
tests/snapshots/output/header_rule.snapshot.txt
Normal file
@ -0,0 +1,23 @@
|
||||
File: sample.rs
|
||||
struct Rectangle {
|
||||
width: u32,
|
||||
height: u32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let rect1 = Rectangle { width: 30, height: 50 };
|
||||
|
||||
println!(
|
||||
"The perimeter of the rectangle is {} pixels.",
|
||||
perimeter(&rect1)
|
||||
);
|
||||
println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
}
|
||||
|
||||
fn area(rectangle: &Rectangle) -> u32 {
|
||||
rectangle.width * rectangle.height
|
||||
}
|
||||
|
||||
fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
(rectangle.width + rectangle.height) * 2
|
||||
}
|
22
tests/snapshots/output/numbers_rule.snapshot.txt
Normal file
22
tests/snapshots/output/numbers_rule.snapshot.txt
Normal file
@ -0,0 +1,22 @@
|
||||
1 struct Rectangle {
|
||||
2 width: u32,
|
||||
3 height: u32,
|
||||
4 }
|
||||
5
|
||||
6 fn main() {
|
||||
7 let rect1 = Rectangle { width: 30, height: 50 };
|
||||
8
|
||||
9 println!(
|
||||
10 "The perimeter of the rectangle is {} pixels.",
|
||||
11 perimeter(&rect1)
|
||||
12 );
|
||||
13 println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
14 }
|
||||
15
|
||||
16 fn area(rectangle: &Rectangle) -> u32 {
|
||||
17 rectangle.width * rectangle.height
|
||||
18 }
|
||||
19
|
||||
20 fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
21 (rectangle.width + rectangle.height) * 2
|
||||
22 }
|
22
tests/snapshots/output/rule.snapshot.txt
Normal file
22
tests/snapshots/output/rule.snapshot.txt
Normal file
@ -0,0 +1,22 @@
|
||||
struct Rectangle {
|
||||
width: u32,
|
||||
height: u32,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let rect1 = Rectangle { width: 30, height: 50 };
|
||||
|
||||
println!(
|
||||
"The perimeter of the rectangle is {} pixels.",
|
||||
perimeter(&rect1)
|
||||
);
|
||||
println!(r#"This line contains invalid utf8: "<22><><EFBFBD><EFBFBD><EFBFBD>"#;
|
||||
}
|
||||
|
||||
fn area(rectangle: &Rectangle) -> u32 {
|
||||
rectangle.width * rectangle.height
|
||||
}
|
||||
|
||||
fn perimeter(rectangle: &Rectangle) -> u32 {
|
||||
(rectangle.width + rectangle.height) * 2
|
||||
}
|
@ -16,11 +16,32 @@ BAT_OPTIONS = [
|
||||
"--italic-text=always",
|
||||
]
|
||||
|
||||
SKIP_FILENAMES = [
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"bat_options",
|
||||
]
|
||||
|
||||
|
||||
def get_options(source):
|
||||
options = BAT_OPTIONS.copy()
|
||||
|
||||
source_dirpath = path.dirname(source)
|
||||
options_file = path.join(source_dirpath, "bat_options")
|
||||
try:
|
||||
with open(options_file, "r") as f:
|
||||
options.extend(map(lambda x: x.rstrip(), f.readlines()))
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
return options
|
||||
|
||||
|
||||
def create_highlighted_versions(output_basepath):
|
||||
root = os.path.dirname(os.path.abspath(__file__))
|
||||
sources = path.join(root, "source", "*")
|
||||
|
||||
for source in glob.glob(path.join(root, "source", "*", "*")):
|
||||
for source in glob.glob(path.join(sources, "*")) + glob.glob(path.join(sources, ".*")):
|
||||
try:
|
||||
env = os.environ.copy()
|
||||
env.pop("PAGER", None)
|
||||
@ -31,16 +52,18 @@ def create_highlighted_versions(output_basepath):
|
||||
env.pop("BAT_TABS", None)
|
||||
env["COLORTERM"] = "truecolor" # make sure to output 24bit colors
|
||||
|
||||
bat_output = subprocess.check_output(
|
||||
["bat"] + BAT_OPTIONS + [source], stderr=subprocess.PIPE, env=env,
|
||||
)
|
||||
|
||||
source_dirname = path.basename(path.dirname(source))
|
||||
source_filename = path.basename(source)
|
||||
|
||||
if source_filename == "LICENSE.md":
|
||||
if source_filename in SKIP_FILENAMES:
|
||||
continue
|
||||
|
||||
bat_output = subprocess.check_output(
|
||||
["bat"] + get_options(source) + [source],
|
||||
stderr=subprocess.PIPE,
|
||||
env=env,
|
||||
)
|
||||
|
||||
output_dir = path.join(output_basepath, source_dirname)
|
||||
output_path = path.join(output_dir, source_filename)
|
||||
|
||||
@ -65,7 +88,10 @@ def create_highlighted_versions(output_basepath):
|
||||
)
|
||||
sys.exit(1)
|
||||
except FileNotFoundError:
|
||||
print("Error: Could not execute 'bat'. Please make sure that the executable is available on the PATH.")
|
||||
print(
|
||||
"Error: Could not execute 'bat'. Please make sure that the executable "
|
||||
"is available on the PATH."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
36
tests/syntax-tests/highlighted/ASP/test.asp
Normal file
36
tests/syntax-tests/highlighted/ASP/test.asp
Normal file
@ -0,0 +1,36 @@
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m
|
||||
[38;2;124;120;101m<!--[0m[38;2;124;120;101m #include file ="headers\header.inc" [0m[38;2;124;120;101m-->[0m
|
||||
|
||||
[38;2;248;248;242m<%[0m
|
||||
[38;2;249;38;114mFor[0m[38;2;248;248;242m [0m[38;2;255;255;255mi[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;249;38;114mTo[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m
|
||||
[3;38;2;166;226;46mResponse[0m[38;2;248;248;242m.[0m[38;2;102;217;239mWrite[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mThe number is [0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242m [0m[38;2;255;255;255mi[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m<br />[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mNext[0m
|
||||
[38;2;248;248;242m%>[0m
|
||||
|
||||
[38;2;248;248;242m<%[0m
|
||||
[3;38;2;166;226;46mResponse[0m[38;2;248;248;242m.[0m[38;2;102;217;239mWrite[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mHello World![0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m%>[0m
|
||||
|
||||
[38;2;248;248;242m<%[0m
|
||||
[38;2;249;38;114mDim[0m[38;2;248;248;242m [0m[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;190;132;255m2[0m[38;2;248;248;242m)[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;190;132;255m0[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mVolvo[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mBMW[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;190;132;255m2[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mFord[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;190;132;255m0[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mApple[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mOrange[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;190;132;255m2[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mBanana[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;190;132;255m0[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mCoke[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mPepsi[0m[38;2;230;219;116m"[0m
|
||||
[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;190;132;255m2[0m[38;2;248;248;242m)[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mSprite[0m[38;2;230;219;116m"[0m
|
||||
[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255mi[0m[38;2;249;38;114m=[0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;249;38;114mto[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m
|
||||
[3;38;2;166;226;46mresponse[0m[38;2;248;248;242m.[0m[38;2;102;217;239mwrite[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116m<p>[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255mj[0m[38;2;249;38;114m=[0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;249;38;114mto[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m
|
||||
[3;38;2;166;226;46mresponse[0m[38;2;248;248;242m.[0m[38;2;102;217;239mwrite[0m[38;2;248;248;242m([0m[38;2;255;255;255mx[0m[38;2;248;248;242m([0m[38;2;255;255;255mi[0m[38;2;248;248;242m,[0m[38;2;255;255;255mj[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m<br />[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mnext[0m
|
||||
[3;38;2;166;226;46mresponse[0m[38;2;248;248;242m.[0m[38;2;102;217;239mwrite[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116m</p>[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mnext[0m
|
||||
[38;2;248;248;242m%>[0m
|
||||
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m
|
75
tests/syntax-tests/highlighted/ActionScript/test.as
Normal file
75
tests/syntax-tests/highlighted/ActionScript/test.as
Normal file
@ -0,0 +1,75 @@
|
||||
[38;2;249;38;114mimport[0m[38;2;248;248;242m flash.events.[0m[38;2;249;38;114m*[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mimport[0m[38;2;248;248;242m flash.events.MouseEvent;[0m
|
||||
|
||||
[38;2;248;248;242mpackage TestSyntax {[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mclass[0m[38;2;248;248;242m [0m[38;2;166;226;46mTestSyntax[0m[38;2;248;248;242m [0m[38;2;249;38;114mextends[0m[38;2;248;248;242m [0m[3;4;38;2;166;226;46mflash.display.Sprite[0m[38;2;248;248;242m {[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[38;2;249;38;114mstatic[0m[38;2;248;248;242m const TEST_CONSTANT[0m[38;2;249;38;114m:[0m[3;38;2;102;217;239mNumber[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m33.333[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m testAttribute[0m[38;2;249;38;114m:[0m[38;2;102;217;239mint[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m namespace TestNamespace;[0m
|
||||
[38;2;248;248;242m TestNamespace [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mMethod2[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;249;38;114m:[0m[38;2;102;217;239mvoid[0m[38;2;248;248;242m { }[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m*[0m
|
||||
[38;2;117;113;94m [0m[38;2;117;113;94m*[0m[38;2;117;113;94m Multi-line comment[0m
|
||||
[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m
|
||||
[38;2;248;248;242m override [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m function [0m[38;2;102;217;239mset[0m[38;2;248;248;242m [0m[38;2;102;217;239mx[0m[38;2;248;248;242m([0m[38;2;102;217;239mvalue[0m[38;2;249;38;114m:[0m[3;38;2;102;217;239mNumber[0m[38;2;248;248;242m)[0m[38;2;249;38;114m:[0m[38;2;102;217;239mvoid[0m
|
||||
[38;2;248;248;242m {[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114msuper[0m[38;2;248;248;242m.[0m[38;2;102;217;239mx[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mMath[0m[38;2;248;248;242m.[0m[38;2;102;217;239mround[0m[38;2;248;248;242m([0m[38;2;102;217;239mvalue[0m[38;2;248;248;242m);[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m*[0m
|
||||
[38;2;117;113;94m [0m[38;2;117;113;94m*[0m[38;2;117;113;94m Actual multi-line comment[0m
|
||||
[38;2;117;113;94m [0m[38;2;117;113;94m*[0m[38;2;117;113;94m Takes up multiple lines[0m
|
||||
[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m
|
||||
[38;2;248;248;242m override [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m function [0m[38;2;102;217;239mset[0m[38;2;248;248;242m y([0m[38;2;102;217;239mvalue[0m[38;2;249;38;114m:[0m[3;38;2;102;217;239mNumber[0m[38;2;248;248;242m)[0m[38;2;249;38;114m:[0m[38;2;102;217;239mvoid[0m
|
||||
[38;2;248;248;242m {[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114msuper[0m[38;2;248;248;242m.y [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mtestFunction[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m {[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m [0m[38;2;102;217;239mtest[0m[38;2;249;38;114m:[0m[3;38;2;102;217;239mString[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mhello[0m[38;2;230;219;116m'[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m arrays[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m testArray[0m[38;2;249;38;114m:[0m[3;38;2;166;226;46mArray[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [[0m[38;2;230;219;116m"[0m[38;2;230;219;116ma[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mb[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mc[0m[38;2;230;219;116m"[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116md[0m[38;2;230;219;116m"[0m[38;2;248;248;242m];[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m ([0m[38;2;249;38;114mvar[0m[38;2;248;248;242m i[0m[38;2;249;38;114m:[0m[38;2;248;248;242muint [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m; i < testArray.[0m[38;2;102;217;239mlength[0m[38;2;248;248;242m; i[0m[38;2;249;38;114m+[0m[38;2;249;38;114m+[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mtrace[0m[38;2;248;248;242m(testArray[i]);[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m objects[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m testObject[0m[38;2;249;38;114m:[0m[3;38;2;166;226;46mObject[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m {foo[0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m20[0m[38;2;248;248;242m, bar[0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m40[0m[38;2;248;248;242m};[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m ([0m[38;2;249;38;114mvar[0m[38;2;248;248;242m key[0m[38;2;249;38;114m:[0m[3;38;2;102;217;239mString[0m[38;2;248;248;242m [0m[38;2;102;217;239min[0m[38;2;248;248;242m testObject) {[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mtrace[0m[38;2;248;248;242m(testObject[key]);[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m each ([0m[38;2;249;38;114mvar[0m[38;2;248;248;242m objectValue[0m[38;2;249;38;114m:[0m[38;2;102;217;239mint[0m[38;2;248;248;242m [0m[38;2;102;217;239min[0m[38;2;248;248;242m testObject) {[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mtrace[0m[38;2;248;248;242m(objectValue);[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m dynamic variables[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m testDynamic[0m[38;2;249;38;114m:[0m[38;2;249;38;114m*[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m testDynamic [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m75[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m testDynamic [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mSeventy-five[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m regex[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m testRegExp[0m[38;2;249;38;114m:[0m[38;2;248;248;242mRegExp [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m/[0m[38;2;248;248;242mfoo[0m[38;2;249;38;114m-[0m[38;2;248;248;242m\d[0m[38;2;249;38;114m+[0m[38;2;249;38;114m/[0m[38;2;248;248;242mi;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m XML[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m testXML[0m[38;2;249;38;114m:[0m[3;38;2;166;226;46mXML[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m
|
||||
[38;2;248;248;242m<employee>[0m
|
||||
[38;2;248;248;242m <firstName>Harold<[0m[38;2;249;38;114m/[0m[38;2;248;248;242mfirstName>[0m
|
||||
[38;2;248;248;242m <lastName>Webster<[0m[38;2;249;38;114m/[0m[38;2;248;248;242mlastName>[0m
|
||||
[38;2;248;248;242m<[0m[38;2;249;38;114m/[0m[38;2;248;248;242memployee>;[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mprivate[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46manotherFunc[0m[38;2;248;248;242m([0m[3;38;2;253;151;31ma:int[0m[38;2;248;248;242m,[0m[3;38;2;253;151;31m arg2:uint[0m[38;2;248;248;242m,[0m[3;38;2;253;151;31m arg3:Function[0m[38;2;248;248;242m,[0m[3;38;2;253;151;31m ... args[0m[38;2;248;248;242m)[0m[38;2;248;248;242m {[0m
|
||||
|
||||
[38;2;248;248;242m }[0m
|
||||
|
||||
[38;2;248;248;242m [Embed([0m[38;2;102;217;239msource[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116msound1.mp3[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)] [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m soundCls[0m[38;2;249;38;114m:[0m[38;2;248;248;242mClass;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mSoundAssetExample[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m {[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m mySound[0m[38;2;249;38;114m:[0m[38;2;248;248;242mSoundAsset [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114mnew[0m[38;2;248;248;242m soundCls() as SoundAsset;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m sndChannel[0m[38;2;249;38;114m:[0m[38;2;248;248;242mSoundChannel [0m[38;2;249;38;114m=[0m[38;2;248;248;242m mySound.[0m[38;2;102;217;239mplay[0m[38;2;248;248;242m();[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
[38;2;248;248;242m }[0m
|
||||
[38;2;248;248;242m}[0m
|
42
tests/syntax-tests/highlighted/Apache/httpd.conf
Normal file
42
tests/syntax-tests/highlighted/Apache/httpd.conf
Normal file
@ -0,0 +1,42 @@
|
||||
[38;2;117;113;94m# This is a comment[0m
|
||||
[38;2;117;113;94m#[0m
|
||||
[38;2;249;38;114mServerRoot[0m[38;2;248;248;242m ""[0m
|
||||
[38;2;249;38;114mListen[0m[38;2;248;248;242m [0m[38;2;190;132;255m80[0m
|
||||
[38;2;249;38;114mLoadModule[0m[38;2;248;248;242m mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so[0m
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mIfModule[0m[38;2;248;248;242m [0m[38;2;230;219;116munixd_module[0m[38;2;255;255;255m>[0m
|
||||
[38;2;249;38;114mUser[0m[38;2;248;248;242m daemon[0m
|
||||
[38;2;249;38;114mGroup[0m[38;2;248;248;242m daemon[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mIfModule[0m[38;2;255;255;255m>[0m
|
||||
[38;2;249;38;114mServerAdmin[0m[38;2;248;248;242m you@example.com[0m
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mDirectory[0m[38;2;248;248;242m [0m[38;2;230;219;116m/[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mAllowOverride[0m[38;2;248;248;242m none[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mRequire[0m[38;2;248;248;242m all denied[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mDirectory[0m[38;2;255;255;255m>[0m
|
||||
[38;2;249;38;114mDocumentRoot[0m[38;2;248;248;242m "/usr/share/apache2/default-site/htdocs"[0m
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mDirectory[0m[38;2;248;248;242m [0m[38;2;230;219;116m"/usr/share/apache2/default-site/htdocs"[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mOptions[0m[38;2;248;248;242m Indexes FollowSymLinks[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mAllowOverride[0m[38;2;248;248;242m None[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mRequire[0m[38;2;248;248;242m all granted[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mDirectory[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mFiles[0m[38;2;248;248;242m [0m[38;2;230;219;116m".ht*"[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mRequire[0m[38;2;248;248;242m all denied[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mFiles[0m[38;2;255;255;255m>[0m
|
||||
[38;2;249;38;114mErrorLog[0m[38;2;248;248;242m "/var/log/apache2/error_log"[0m
|
||||
[38;2;249;38;114mLogLevel[0m[38;2;248;248;242m warn[0m
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mIfModule[0m[38;2;248;248;242m [0m[38;2;230;219;116mlog_config_module[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mLogFormat[0m[38;2;248;248;242m "%h %l %u %t \"%r\" %>s %b \"[0m[38;2;248;248;242m%{[0m[38;2;248;248;242mReferer[0m[38;2;248;248;242m}[0m[38;2;248;248;242mi\" \"[0m[38;2;248;248;242m%{[0m[38;2;248;248;242mUser-Agent[0m[38;2;248;248;242m}[0m[38;2;248;248;242mi\"" combined[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mCustomLog[0m[38;2;248;248;242m "/var/log/apache2/access_log" common[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mIfModule[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mIfModule[0m[38;2;248;248;242m [0m[38;2;230;219;116malias_module[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mScriptAlias[0m[38;2;248;248;242m [0m[38;2;230;219;116m/cgi-bin/[0m[38;2;248;248;242m [0m[38;2;230;219;116m"/usr/lib/cgi-bin/"[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mIfModule[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mIfModule[0m[38;2;248;248;242m [0m[38;2;230;219;116mmime_module[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mTypesConfig[0m[38;2;248;248;242m /etc/apache2/mime.types[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mAddType[0m[38;2;248;248;242m [0m[38;2;166;226;46mapplication/x-compress[0m[38;2;248;248;242m .Z[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mAddOutputFilter[0m[38;2;248;248;242m INCLUDES .shtml[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mIfModule[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m<[0m[38;2;166;226;46mIfModule[0m[38;2;248;248;242m [0m[38;2;230;219;116mproxy_html_module[0m[38;2;255;255;255m>[0m
|
||||
[38;2;249;38;114mInclude[0m[38;2;248;248;242m /etc/apache2/extra/proxy-html.conf[0m
|
||||
[38;2;255;255;255m</[0m[38;2;166;226;46mIfModule[0m[38;2;255;255;255m>[0m
|
25
tests/syntax-tests/highlighted/AppleScript/test.applescript
Normal file
25
tests/syntax-tests/highlighted/AppleScript/test.applescript
Normal file
@ -0,0 +1,25 @@
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m This is a comment[0m
|
||||
|
||||
[38;2;249;38;114mproperty[0m[38;2;248;248;242m [0m[38;2;255;255;255mdefaultClientName[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mMary Smith[0m[38;2;230;219;116m"[0m
|
||||
|
||||
[38;2;249;38;114mon[0m[38;2;248;248;242m [0m[38;2;166;226;46mgreetClient[0m[38;2;248;248;242m([0m[3;38;2;253;151;31mnameOfClient[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mdisplay dialog[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mHello [0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242m nameOfClient [0m[38;2;249;38;114m&[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m![0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mend[0m[38;2;248;248;242m greetClient[0m
|
||||
|
||||
|
||||
[38;2;249;38;114mscript[0m[38;2;248;248;242m [0m[38;2;166;226;46mtestGreet[0m
|
||||
[38;2;248;248;242m greetClient[0m[38;2;248;248;242m([0m[38;2;248;248;242mdefaultClientName[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mend script[0m
|
||||
|
||||
[38;2;102;217;239mrun[0m[38;2;248;248;242m testGreet[0m
|
||||
[38;2;248;248;242mgreetClient[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mJoe Jones[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mmyList[0m[38;2;248;248;242m [0m[38;2;249;38;114mto[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mwhat[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;248;248;242m}[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;249;38;114mbeginning[0m[38;2;248;248;242m [0m[38;2;249;38;114mof[0m[38;2;248;248;242m myList [0m[38;2;249;38;114mto[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;249;38;114mof[0m[38;2;248;248;242m myList [0m[38;2;249;38;114mto[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mfour[0m[38;2;230;219;116m"[0m
|
||||
|
||||
[38;2;248;248;242mmyList[0m
|
||||
|
||||
[38;2;249;38;114mtell[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mapplication[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mTextEdit[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;166;226;46mparagraph[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114mof[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mdocument[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m
|
||||
[38;2;249;38;114mend tell[0m
|
86
tests/syntax-tests/highlighted/Assembly (x86_64)/test.nasm
Normal file
86
tests/syntax-tests/highlighted/Assembly (x86_64)/test.nasm
Normal file
@ -0,0 +1,86 @@
|
||||
[38;2;102;217;239mglobal[0m[38;2;248;248;242m [0m[38;2;166;226;46menlight[0m
|
||||
|
||||
[38;2;102;217;239msection[0m[38;2;248;248;242m [0m[38;2;102;217;239m.data[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mred[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdq[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;117;113;94m;[0m[38;2;117;113;94m some comment[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mgreen[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdq[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mblue[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdq[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mdata[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdq[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mN[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdd[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mM[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdd[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mchange[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdd[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46mdelta[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdb[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
|
||||
[38;2;102;217;239msection[0m[38;2;248;248;242m [0m[38;2;102;217;239m.text[0m
|
||||
[38;2;166;226;46menlight[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcall[0m[38;2;248;248;242m [0m[38;2;166;226;46massign_arguments[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcall[0m[38;2;248;248;242m [0m[38;2;166;226;46mset_data[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcall[0m[38;2;248;248;242m [0m[38;2;166;226;46mmake_deltas[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
|
||||
[38;2;166;226;46massign_arguments[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mred[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrdi[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mgreen[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrsi[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mblue[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrdx[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mN[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mecx[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mM[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mr8d[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mchange[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mr9d[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mal[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrsp[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;190;132;255m16[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;166;226;46mdelta[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mal[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
|
||||
[38;2;166;226;46mset_data[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255meax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mchange[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcmp[0m[38;2;248;248;242m [0m[38;2;190;132;255meax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mjne[0m[38;2;248;248;242m [0m[38;2;166;226;46mnot_1[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mred[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mdata[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
[38;2;166;226;46mnot_1[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcmp[0m[38;2;248;248;242m [0m[38;2;190;132;255meax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mjne[0m[38;2;248;248;242m [0m[38;2;166;226;46mnot_2[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mgreen[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mdata[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
[38;2;166;226;46mnot_2[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mblue[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mdata[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
|
||||
|
||||
[38;2;166;226;46mmake_deltas[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mecx[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mN[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255meax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mdword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mM[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mimul[0m[38;2;248;248;242m [0m[38;2;190;132;255mecx[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255meax[0m
|
||||
[38;2;166;226;46mloop_start[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcall[0m[38;2;248;248;242m [0m[38;2;166;226;46mmake_delta[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mloop[0m[38;2;248;248;242m [0m[38;2;166;226;46mloop_start[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
|
||||
[38;2;166;226;46mmake_delta[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mqword[0m[38;2;248;248;242m[[0m[38;2;166;226;46mdata[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114madd[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mrcx[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mdec[0m[38;2;248;248;242m [0m[38;2;190;132;255mrax[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;166;226;46mdelta[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcmp[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mjl[0m[38;2;248;248;242m [0m[38;2;166;226;46msubstracting[0m
|
||||
[38;2;166;226;46madding[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114madd[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrax[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mjc[0m[38;2;248;248;242m [0m[38;2;166;226;46madding_overflow[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrax[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
[38;2;166;226;46madding_overflow[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrax[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m255[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
[38;2;166;226;46msubstracting[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mr9b[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114msub[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mr9b[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[38;2;190;132;255mr8b[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrax[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114msub[0m[38;2;248;248;242m [0m[38;2;190;132;255mr8b[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mdl[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mjc[0m[38;2;248;248;242m [0m[38;2;166;226;46msubstracting_overflow[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrax[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mr8b[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
||||
[38;2;117;113;94m;[0m[38;2;117;113;94m another comment[0m
|
||||
[38;2;166;226;46msubstracting_overflow[0m[38;2;248;248;242m:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmov[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mbyte[0m[38;2;248;248;242m[[0m[38;2;190;132;255mrax[0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mret[0m
|
59
tests/syntax-tests/highlighted/Batch/build.bat
Normal file
59
tests/syntax-tests/highlighted/Batch/build.bat
Normal file
@ -0,0 +1,59 @@
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114mecho[0m[38;2;248;248;242m off[0m
|
||||
|
||||
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Change to your LLVM installation[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mLLVMPath[0m[38;2;249;38;114m=[0m[38;2;230;219;116mC:\Program Files\LLVM[0m[38;2;230;219;116m"[0m
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Change to your Visual Studio 2017 installation[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mVSPath[0m[38;2;249;38;114m=[0m[38;2;230;219;116mC:\Program Files [0m[38;2;230;219;116m([0m[38;2;230;219;116mx86[0m[38;2;230;219;116m)[0m[38;2;230;219;116m\Microsoft Visual Studio\[0m[38;2;190;132;255m2017[0m[38;2;230;219;116m\Community[0m[38;2;230;219;116m"[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mVSVersion[0m[38;2;249;38;114m=[0m[38;2;190;132;255m14[0m[38;2;230;219;116m.[0m[38;2;190;132;255m10[0m[38;2;230;219;116m.[0m[38;2;190;132;255m25017[0m[38;2;230;219;116m"[0m
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Change to your Windows Kit version & installation[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;249;38;114m=[0m[38;2;190;132;255m10[0m[38;2;230;219;116m.[0m[38;2;190;132;255m0[0m[38;2;230;219;116m.[0m[38;2;190;132;255m15063[0m[38;2;230;219;116m.[0m[38;2;190;132;255m0[0m[38;2;230;219;116m"[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mWinSDKPath[0m[38;2;249;38;114m=[0m[38;2;230;219;116mC:\Program Files [0m[38;2;230;219;116m([0m[38;2;230;219;116mx86[0m[38;2;230;219;116m)[0m[38;2;230;219;116m\Windows Kits\[0m[38;2;190;132;255m10[0m[38;2;230;219;116m"[0m
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Change this to your resulting exe[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mOUTPUT[0m[38;2;249;38;114m=[0m[38;2;230;219;116mtest.exe[0m[38;2;230;219;116m"[0m
|
||||
|
||||
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Setup[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mVSBasePath[0m[38;2;249;38;114m=[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\VC\Tools\MSVC\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m"[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mPATH[0m[38;2;249;38;114m=[0m[38;2;255;255;255m%[0m[38;2;255;255;255mPATH[0m[38;2;255;255;255m%[0m[38;2;230;219;116m;[0m[38;2;255;255;255m%[0m[38;2;255;255;255mLLVMPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\bin;[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSBasePath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\bin\HostX64\x64[0m[38;2;230;219;116m"[0m
|
||||
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Compiler Flags[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mCFLAGS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m
|
||||
[38;2;248;248;242m -std=c++[0m[38;2;190;132;255m14[0m[38;2;248;248;242m -Wall -Wextra[0m
|
||||
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mCPPFLAGS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m
|
||||
[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSBasePath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\include[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Include\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\shared[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Include\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\ucrt[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Include\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\um[0m[38;2;230;219;116m"[0m
|
||||
|
||||
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Linker Libs[0m
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mLDFLAGS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m
|
||||
[38;2;248;248;242m -machine:x64 [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -nodefaultlib [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -subsystem:console[0m
|
||||
|
||||
[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mLDLIBS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m
|
||||
[38;2;248;248;242m -libpath:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSBasePath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\lib\x64[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -libpath:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Lib\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\ucrt\x64[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m -libpath:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Lib\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\um\x64[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m legacy_stdio_definitions.lib oldnames.lib [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m legacy_stdio_wide_specifiers.lib [0m[38;2;190;132;255m^[0m
|
||||
[38;2;248;248;242m kernel32.lib User32.lib[0m
|
||||
|
||||
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Compiling[0m
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114mecho[0m[38;2;248;248;242m on[0m
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;190;132;255m%%[0m[38;2;248;248;242mf in [0m[38;2;248;248;242m([0m[38;2;248;248;242m*.cc[0m[38;2;248;248;242m)[0m[38;2;248;248;242m do [0m[38;2;248;248;242m([0m
|
||||
[38;2;248;248;242m clang++.exe [0m[38;2;230;219;116m"[0m[38;2;190;132;255m%%[0m[38;2;230;219;116m~f[0m[38;2;230;219;116m"[0m[38;2;248;248;242m -o [0m[38;2;230;219;116m"[0m[38;2;190;132;255m%%[0m[38;2;230;219;116m~nf.o[0m[38;2;230;219;116m"[0m[38;2;248;248;242m -c [0m[38;2;255;255;255m%[0m[38;2;255;255;255mCFLAGS[0m[38;2;255;255;255m%[0m
|
||||
[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;117;113;94m::[0m[38;2;117;113;94m Linking[0m
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mLINK_FILES[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;190;132;255m%%[0m[38;2;248;248;242mf in [0m[38;2;248;248;242m([0m[38;2;248;248;242m*.o[0m[38;2;248;248;242m)[0m[38;2;248;248;242m do [0m[38;2;248;248;242m([0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mLINK_FILES[0m[38;2;249;38;114m=[0m[38;2;255;255;255m%[0m[38;2;255;255;255mLINK_FILES[0m[38;2;255;255;255m%[0m[38;2;230;219;116m [0m[38;2;190;132;255m%%[0m[38;2;230;219;116m~f[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;248;248;242mlld-link.exe [0m[38;2;255;255;255m%[0m[38;2;255;255;255mLINK_FILES[0m[38;2;255;255;255m%[0m[38;2;248;248;242m -out:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mOUTPUT[0m[38;2;255;255;255m%[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;255;255;255m%[0m[38;2;255;255;255mLDFLAGS[0m[38;2;255;255;255m%[0m[38;2;248;248;242m [0m[38;2;255;255;255m%[0m[38;2;255;255;255mLDLIBS[0m[38;2;255;255;255m%[0m
|
18
tests/syntax-tests/highlighted/BibTeX/test.bib
Normal file
18
tests/syntax-tests/highlighted/BibTeX/test.bib
Normal file
@ -0,0 +1,18 @@
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114mbook[0m[38;2;248;248;242m{[0m[38;2;166;226;46mknuth1997art[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mtitle[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mThe art of computer programming[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mauthor[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mKnuth, Donald Ervin[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mvolume[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116m3[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116myear[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116m1997[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mpublisher[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mPearson Education[0m[38;2;230;219;116m}[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
[38;2;249;38;114m@[0m[38;2;249;38;114marticle[0m[38;2;248;248;242m{[0m[38;2;166;226;46megholm1993pna[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mtitle[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mPNA hybridizes to complementary oligonucleotides obeying the Watson--Crick hydrogen-bonding rules[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mauthor[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mEgholm, Michael and Buchardt, Ole and Christensen, Leif and Behrens, Carsten and Freier, Susan M and Driver, David A and Berg, Rolf H and Kim, Seog K and Norden, Bengt and Nielsen, Peter E[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mjournal[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mNature[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mvolume[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116m365[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mnumber[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116m6446[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mpages[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116m566--568[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116myear[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116m1993[0m[38;2;230;219;116m}[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116mpublisher[0m[38;2;248;248;242m=[0m[38;2;230;219;116m{[0m[38;2;230;219;116mSpringer[0m[38;2;230;219;116m}[0m
|
||||
[38;2;248;248;242m}[0m
|
16
tests/syntax-tests/highlighted/CMake/CMakeLists.txt
Normal file
16
tests/syntax-tests/highlighted/CMake/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
[38;2;117;113;94m#[0m[38;2;117;113;94m This is a file for testing syntax highlighting.[0m
|
||||
[38;2;102;217;239mcmake_minimum_required[0m[38;2;248;248;242m([0m[3;38;2;253;151;31mVERSION[0m[38;2;248;248;242m [0m[38;2;248;248;242m3.13[0m[38;2;248;248;242m)[0m
|
||||
[38;2;102;217;239mproject[0m[38;2;248;248;242m([0m[38;2;248;248;242mhello-bat[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mVERSION[0m[38;2;248;248;242m [0m[38;2;248;248;242m0.0.1[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mLANGUAGES[0m[38;2;248;248;242m [0m[38;2;248;248;242mC[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m([0m[38;2;255;255;255mSOURCE_DIR[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255m$[0m[38;2;230;219;116m{[0m[38;2;255;255;255mCMAKE_CURRENT_SOURCE_DIR[0m[38;2;230;219;116m}[0m[38;2;230;219;116m/src/[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;102;217;239mfile[0m[38;2;248;248;242m([0m[3;38;2;253;151;31mGLOB_RECURSE[0m[38;2;248;248;242m [0m[38;2;248;248;242mSOURCES[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255m$[0m[38;2;230;219;116m{[0m[38;2;255;255;255mSOURCE_DIR[0m[38;2;230;219;116m}[0m[38;2;230;219;116m/*.c[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;102;217;239madd_executable[0m[38;2;248;248;242m([0m[38;2;248;248;242mhello-bat[0m[38;2;248;248;242m [0m[38;2;248;248;242mSOURCES[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;102;217;239mfind_package[0m[38;2;248;248;242m([0m[38;2;248;248;242massimp[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mCONFIG[0m[38;2;248;248;242m)[0m
|
||||
[38;2;102;217;239mtarget_link_libraries[0m[38;2;248;248;242m([0m[38;2;248;248;242mhello-bat[0m[38;2;248;248;242m [0m[38;2;248;248;242massimp[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;102;217;239moption[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mENABLE_TESTS[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;248;248;242mOFF[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mif[0m[38;2;248;248;242m([0m[38;2;248;248;242mENABLE_TESTS[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239madd_subdirectory[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;255;255;255m$[0m[38;2;230;219;116m{[0m[38;2;255;255;255mCMAKE_CURRENT_SOURCE_DIR[0m[38;2;230;219;116m}[0m[38;2;230;219;116m/tests/[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mendif[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m
|
115
tests/syntax-tests/highlighted/CSS/style.css
Normal file
115
tests/syntax-tests/highlighted/CSS/style.css
Normal file
@ -0,0 +1,115 @@
|
||||
[38;2;117;113;94m/*[0m[38;2;117;113;94mScrolling[0m[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mhtml[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mscroll-behavior[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239msmooth[0m[38;2;255;255;255m;[0m[38;2;248;248;242m [0m[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m[38;2;117;113;94mHeader text[0m[38;2;117;113;94m*/[0m
|
||||
[38;2;166;226;46m.[0m[38;2;166;226;46mjumbotron[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mbackground-image[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239mlinear-gradient[0m[38;2;255;255;255m([0m[38;2;190;132;255m90[0m[38;2;249;38;114mdeg[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m849EB5[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m30394A[0m[38;2;255;255;255m)[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mpadding-bottom[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m20[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mpadding-top[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m20[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mtext-shadow[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114mpx[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;249;38;114mpx[0m[38;2;248;248;242m [0m[38;2;190;132;255m4[0m[38;2;249;38;114mpx[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m000000[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;166;226;46m.[0m[38;2;166;226;46mcontainer[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mmargin-top[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m-25[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m[38;2;117;113;94mBackground related[0m[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mbody[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mbackground[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m161616[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m[38;2;117;113;94mText related CSS[0m[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mh4[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-size[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m70[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mFFFFFF[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114mh3[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255me5e5e5[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114mp[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-size[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m17[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mDEDEDE[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;248;248;242mp2 [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-size[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m24[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mDEDEDE[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;248;248;242mdate [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-style[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239mitalic[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-size[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m17[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mDEDEDE[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;248;248;242mjobtitle [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-size[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m17[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-weight[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239mbold[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mDEDEDE[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;248;248;242mjobtilenolink [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-size[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m17[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-weight[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239mbold[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mDEDEDE[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114mli[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mfont-family[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mNews Cycle[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;102;217;239mserif[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255mDEDEDE[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
|
||||
|
||||
[38;2;249;38;114ma[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4A8ECC[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114mp[0m[38;2;248;248;242m [0m[38;2;249;38;114ma[0m[38;2;166;226;46m:[0m[38;2;166;226;46mvisited[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4A8ECC[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;166;226;46m.[0m[38;2;166;226;46mhref[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4A8ECC[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114ma[0m[38;2;166;226;46m:[0m[38;2;166;226;46mvisited[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4A8ECC[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114mp[0m[38;2;248;248;242m [0m[38;2;249;38;114ma[0m[38;2;166;226;46m:[0m[38;2;166;226;46mhover[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4FB1F4[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;249;38;114ma[0m[38;2;166;226;46m:[0m[38;2;166;226;46mhover[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4FB1F4[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;248;248;242mjobtitle[0m[38;2;166;226;46m:[0m[38;2;166;226;46mhover[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mcolor[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m4FB1F4[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m[38;2;117;113;94mSection[0m[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114msection[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mbackground-color[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m1B1B1B[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mpadding[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m20[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mmargin[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m-5[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mmargin-bottom[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m30[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mbox-shadow[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114mpx[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;249;38;114mpx[0m[38;2;248;248;242m [0m[38;2;190;132;255m4[0m[38;2;249;38;114mpx[0m[38;2;248;248;242m [0m[38;2;102;217;239mrgba[0m[38;2;255;255;255m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;190;132;255m0[0m[38;2;190;132;255m.[0m[38;2;190;132;255m3[0m[38;2;255;255;255m)[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
||||
|
||||
|
||||
[38;2;117;113;94m/*[0m[38;2;117;113;94mIcon related[0m[38;2;117;113;94m*/[0m
|
||||
[38;2;166;226;46m.[0m[38;2;166;226;46micon[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mposition[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239mrelative[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mtop[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mright[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m[38;2;249;38;114mpx[0m[38;2;255;255;255m;[0m
|
||||
[38;2;255;255;255m}[0m
|
7
tests/syntax-tests/highlighted/CSV/comma_in_quotes.csv
Normal file
7
tests/syntax-tests/highlighted/CSV/comma_in_quotes.csv
Normal file
@ -0,0 +1,7 @@
|
||||
[3;38;2;102;217;239mfirst[0m[38;2;249;38;114m,[0m[3;38;2;102;217;239mlast[0m[38;2;249;38;114m,[0m[3;38;2;102;217;239maddress[0m[38;2;249;38;114m,[0m[3;38;2;102;217;239mcity[0m[38;2;249;38;114m,[0m[3;38;2;102;217;239mzip[0m
|
||||
[3;38;2;102;217;239mJohn[0m[38;2;249;38;114m,[0m[3;38;2;102;217;239mDoe[0m[38;2;249;38;114m,[0m[38;2;190;132;255m120[0m[38;2;248;248;242m [0m[3;38;2;102;217;239many[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mst.[0m[38;2;249;38;114m,[0m[38;2;230;219;116m"[0m[3;38;2;102;217;239mAnytown[0m[38;2;249;38;114m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mWW[0m[38;2;230;219;116m"[0m[38;2;249;38;114m,[0m[38;2;190;132;255m08123[0m
|
||||
[3;38;2;102;217;239ma[0m[38;2;249;38;114m,[0m[3;38;2;102;217;239mb[0m
|
||||
[38;2;190;132;255m1[0m[38;2;249;38;114m,[0m[38;2;230;219;116m"[0m[3;38;2;102;217;239mha[0m[38;2;248;248;242m [0m
|
||||
[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[3;38;2;102;217;239mha[0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m
|
||||
[3;38;2;102;217;239mha[0m[38;2;230;219;116m"[0m[38;2;249;38;114m,[0m[38;2;190;132;255m120[0m[38;2;248;248;242m [0m[3;38;2;102;217;239many[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mst.[0m[38;2;249;38;114m,[0m[38;2;230;219;116m"[0m[3;38;2;102;217;239mAnytown[0m[38;2;249;38;114m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mWW[0m[38;2;230;219;116m"[0m[38;2;249;38;114m,[0m[38;2;190;132;255m08123[0m
|
||||
[38;2;190;132;255m3[0m[38;2;249;38;114m,[0m[38;2;190;132;255m4[0m[38;2;249;38;114m,[0m[38;2;190;132;255m120[0m[38;2;248;248;242m [0m[3;38;2;102;217;239many[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mst.[0m[38;2;249;38;114m,[0m[38;2;230;219;116m"[0m[3;38;2;102;217;239mAnytown[0m[38;2;249;38;114m,[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mWW[0m[38;2;230;219;116m"[0m[38;2;249;38;114m,[0m[38;2;190;132;255m08123[0m
|
Can't render this file because it contains an unexpected character in line 2 and column 276.
|
58
tests/syntax-tests/highlighted/Clojure/test.clj
Normal file
58
tests/syntax-tests/highlighted/Clojure/test.clj
Normal file
@ -0,0 +1,58 @@
|
||||
[38;2;248;248;242m([0m[38;2;248;248;242mns[0m[38;2;248;248;242m clojure-sample.core[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255m:[0m[38;2;190;132;255mgen-class[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mrequire[0m[38;2;248;248;242m [0m[38;2;249;38;114m'[0m[38;2;248;248;242m[[0m[38;2;248;248;242mclj-time.core [0m[38;2;190;132;255m:[0m[38;2;190;132;255mas[0m[38;2;248;248;242m t[0m[38;2;248;248;242m][0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mrequire[0m[38;2;248;248;242m [0m[38;2;249;38;114m'[0m[38;2;248;248;242m[[0m[38;2;248;248;242mclj-time.format [0m[38;2;190;132;255m:[0m[38;2;190;132;255mas[0m[38;2;248;248;242m f[0m[38;2;248;248;242m][0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m Product record[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;102;217;239mdefrecord[0m[38;2;248;248;242m [0m[38;2;166;226;46mProduct[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242mid name available price[0m[38;2;248;248;242m][0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m Positional constructor[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mproduct1[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m->Product[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m1[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mT-Shirt 1[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m [0m[38;2;190;132;255m15[0m[38;2;190;132;255m.[0m[38;2;190;132;255m00[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m Map constructor[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mproduct2[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mmap->Product[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m{[0m[38;2;190;132;255m:[0m[38;2;190;132;255mid[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m2[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mname[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mT-Shirt 2[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mavailable[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mprice[0m[38;2;248;248;242m [0m[38;2;190;132;255m20[0m[38;2;190;132;255m.[0m[38;2;190;132;255m00[0m[38;2;248;248;242m}[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m Nested[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mproduct3[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m[38;2;190;132;255m:[0m[38;2;190;132;255mid[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m1[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mname[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mProduct 1[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mavailable[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255msellers[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m{[0m[38;2;190;132;255m:[0m[38;2;190;132;255mid[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m1[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mname[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mSeller 1[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mstock[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;248;248;242m}[0m[38;2;117;113;94m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m{[0m[38;2;190;132;255m:[0m[38;2;190;132;255mid[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mname[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mSeller 2[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255mstock[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m[38;2;248;248;242m}[0m[38;2;248;248;242m][0m[38;2;248;248;242m}[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m Set[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mcategories[0m[38;2;248;248;242m [0m[38;2;248;248;242m#{[0m[38;2;230;219;116m"[0m[38;2;230;219;116mshirts[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mshoes[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mbelts[0m[38;2;230;219;116m"[0m[38;2;248;248;242m}[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m List[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mwishlist[0m[38;2;248;248;242m [0m[38;2;249;38;114m'[0m[38;2;248;248;242m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m;;[0m[38;2;117;113;94m Recursion[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdefn[0m[38;2;248;248;242m [0m[38;2;166;226;46mfactorial[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242mvalue[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mcond[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m<=[0m[38;2;248;248;242m value [0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m:[0m[38;2;190;132;255melse[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m*[0m[38;2;248;248;242m value [0m[38;2;248;248;242m([0m[38;2;248;248;242mfactorial[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m-[0m[38;2;248;248;242m value [0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mbasic-formatter[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mf/formatter[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mYYYY-MM-dd hh:mm:ss[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdefn[0m[38;2;248;248;242m [0m[38;2;166;226;46mnow[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mf/unparse[0m[38;2;248;248;242m basic-formatter [0m[38;2;248;248;242m([0m[38;2;248;248;242mt/now[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdefn[0m[38;2;248;248;242m [0m[38;2;166;226;46mlog[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnow[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mNo message[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m[[0m[38;2;248;248;242mmessage[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnow[0m[38;2;248;248;242m)[0m[38;2;248;248;242m message[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdefn[0m[38;2;248;248;242m [0m[38;2;166;226;46m-main[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m& args[0m[38;2;248;248;242m][0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255m:[0m[38;2;190;132;255mid[0m[38;2;248;248;242m product1[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255m:[0m[38;2;190;132;255mname[0m[38;2;248;248;242m product2[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255m:[0m[38;2;190;132;255mname[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mget[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255m:[0m[38;2;190;132;255msellers[0m[38;2;248;248;242m product3[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mfirst[0m[38;2;248;248;242m categories[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m wishlist[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mprintln[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mfactorial[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mlog[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mlog[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mMessage[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m
|
45
tests/syntax-tests/highlighted/CpuInfo/test.CpuInfo
Normal file
45
tests/syntax-tests/highlighted/CpuInfo/test.CpuInfo
Normal file
@ -0,0 +1,45 @@
|
||||
[38;2;248;248;242mprocessor : 0[0m
|
||||
[38;2;248;248;242mmodel name : ARMv7 Processor rev 3 (v7l)[0m
|
||||
[38;2;248;248;242mBogoMIPS : 270.00[0m
|
||||
[38;2;248;248;242mFeatures : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32[0m
|
||||
[38;2;248;248;242mCPU implementer : 0x41[0m
|
||||
[38;2;248;248;242mCPU architecture: 7[0m
|
||||
[38;2;248;248;242mCPU variant : 0x0[0m
|
||||
[38;2;248;248;242mCPU part : 0xd08[0m
|
||||
[38;2;248;248;242mCPU revision : 3[0m
|
||||
|
||||
[38;2;248;248;242mprocessor : 1[0m
|
||||
[38;2;248;248;242mmodel name : ARMv7 Processor rev 3 (v7l)[0m
|
||||
[38;2;248;248;242mBogoMIPS : 270.00[0m
|
||||
[38;2;248;248;242mFeatures : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32[0m
|
||||
[38;2;248;248;242mCPU implementer : 0x41[0m
|
||||
[38;2;248;248;242mCPU architecture: 7[0m
|
||||
[38;2;248;248;242mCPU variant : 0x0[0m
|
||||
[38;2;248;248;242mCPU part : 0xd08[0m
|
||||
[38;2;248;248;242mCPU revision : 3[0m
|
||||
|
||||
[38;2;248;248;242mprocessor : 2[0m
|
||||
[38;2;248;248;242mmodel name : ARMv7 Processor rev 3 (v7l)[0m
|
||||
[38;2;248;248;242mBogoMIPS : 270.00[0m
|
||||
[38;2;248;248;242mFeatures : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32[0m
|
||||
[38;2;248;248;242mCPU implementer : 0x41[0m
|
||||
[38;2;248;248;242mCPU architecture: 7[0m
|
||||
[38;2;248;248;242mCPU variant : 0x0[0m
|
||||
[38;2;248;248;242mCPU part : 0xd08[0m
|
||||
[38;2;248;248;242mCPU revision : 3[0m
|
||||
|
||||
[38;2;248;248;242mprocessor : 3[0m
|
||||
[38;2;248;248;242mmodel name : ARMv7 Processor rev 3 (v7l)[0m
|
||||
[38;2;248;248;242mBogoMIPS : 270.00[0m
|
||||
[38;2;248;248;242mFeatures : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32[0m
|
||||
[38;2;248;248;242mCPU implementer : 0x41[0m
|
||||
[38;2;248;248;242mCPU architecture: 7[0m
|
||||
[38;2;248;248;242mCPU variant : 0x0[0m
|
||||
[38;2;248;248;242mCPU part : 0xd08[0m
|
||||
[38;2;248;248;242mCPU revision : 3[0m
|
||||
|
||||
[38;2;248;248;242mHardware : BCM2711[0m
|
||||
[38;2;248;248;242mRevision : b03111[0m
|
||||
[38;2;248;248;242mSerial : 1000000095fd9fc5[0m
|
||||
[38;2;248;248;242mModel : Raspberry Pi 4 Model B Rev 1.1[0m
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user