Files
carbon-lang/utils/textmate/Samples/literals.carbon
T
Chandler Carruth 25b77cd3d4 Revert "Improve the TextMate grammar scopes and precision (#7888)" (#7909)
This reverts commit 65a3c2b36a.

It was merged by accident with a dependent change. Will re-land
independently.
2026-10-06 20:17:51 +00:00

69 lines
904 B
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// --- string
'C'
"Hello\nWorld\n"
"\"\'\t\r\n"
'''Single line string'''
''' Multi line
string
'''
'''py
Block literal with a file type indicator.
'''
#"a raw \n literal, where \#n is the escape"#
##"nested "# stays inside, and \##n is the escape"##
#'''
A raw block literal.
'''#
"unterminated
// --- characters
'a' '\n' '\0' '\u{1F600}'
'\x70'
''
'abcde'
// --- true-false
true false
// --- type-literals
array auto bool char str type
i8 i16 i32 i64 i128 i10
u8 u16 u32 u64 u128 u11
f8 f16 f32 f64 f128 f12
// --- numbers
12345 6789 00012345
1234.56789
0.875
0.3e5
1e5
.123
.1e3
0o755
0o_17
0o8
0b1011_0010
0b_010
0b2345
0B011
0x2AE5
0x_F109
0xD8_E2.5F_7Bp8
0xabcdef.abcdef
0XA85CE