# Literals and escapes

Yeho has text, character, integer, floating-point, boolean, and null literals with explicit escape sequences.

Last updated: 2026-09-09

Package: language | Status: stable

Tags: cpu, false, language, null, true, values, yeho

Use literals for small values that are obvious at the point of use. Give repeated domain values a named field or function.

```yh
"text"
'c'
42
3.14
6.02e23
true
false
null
```


## Literal forms

Use literals for small values that are obvious at the point of use. Give repeated domain values a named field or function.

Verification: type checked

```yh
class Pilot { }
text greeting = "hello\nworld"
char initial = 'Y'
int count = 42
float ratio = 1.5
bool ready = true
Pilot? selected = null

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__literals"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/language--literals/complete-0 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Supported escapes include \\, \n, \r, \t, \0, escaped quotes, and Unicode \u{...}.

Interpolated text and hex, binary, or separator numeric literals are not admitted.

Source: yeho/docs/language/language-core.md §2.6-2.9; lexer literal fixtures

AI training permission: https://demonhunterlabs.com/ai-use
