aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 19:54:51 -0400
committerGitHub <noreply@github.com>2025-09-13 19:54:51 -0400
commita697921c2556eb14f10fb54117f83dca4fffd027 (patch)
treea11d30a333c1a6f491d93a4212ca96af7d5b62af
parent447f9378d701f752a321d6fc0fe1b10e1c2c6781 (diff)
parent77491d6ac382a307c2d475553b614cd0ac39eea1 (diff)
Merge pull request #1009 from BradLewis/feat/add-string16-cstring16-types
Add string16 and cstring16 types
-rw-r--r--src/server/ast.odin2
-rw-r--r--src/server/documentation.odin4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin
index 2580338..1ecbb42 100644
--- a/src/server/ast.odin
+++ b/src/server/ast.odin
@@ -12,7 +12,9 @@ import "core:strings"
keyword_map: map[string]struct{} = {
"typeid" = {},
"string" = {},
+ "string16" = {},
"cstring" = {},
+ "cstring16" = {},
"int" = {},
"uint" = {},
"u8" = {},
diff --git a/src/server/documentation.odin b/src/server/documentation.odin
index 6f591a4..0dc058f 100644
--- a/src/server/documentation.odin
+++ b/src/server/documentation.odin
@@ -11,7 +11,9 @@ import "core:strings"
keywords_docs: map[string]string = {
"typeid" = "```odin\ntypeid :: typeid\n```\n`typeid` is a unique identifier for an Odin type at runtime. It can be mapped to relevant type information through `type_info_of`.",
"string" = "```odin\nstring :: string\n```\n`string` is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8 encoding text. A `string` may be empty but not `nil`. Elements of `string` type are immutable and indexable.",
+ "string16" = "",
"cstring" = "```odin\ncstring :: cstring\n```\n`cstring` is the set of all strings of 8-bit bytes terminated with a NUL (0) byte, conventionally but not necessarily representing UTF-8 encoding text. A `cstring` may be empty or `nil`. Elements of `cstring` type are immutable but not indexable.",
+ "cstring16" = "",
"int" = "```odin\nint :: int\n```\n`int` is a signed integer type that is at least 32 bits in size. It is a distinct type, however, and not an alias for say, `i32`.",
"uint" = "```odin\nuint :: uint\n```\n`uint` is an unsigned integer type that is at least 32 bits in size. It is a distinct type, however, and not an alias for say, `u32`.",
"u8" = "```odin\nu8 :: u8\n```\n`u8` is the set of all unsigned 8-bit integers. Range 0 through 255.",
@@ -489,7 +491,7 @@ write_proc_param_list_and_return :: proc(sb: ^strings.Builder, value: SymbolProc
add_parens := false
if len(value.orig_return_types) > 1 {
add_parens = true
- } else if field, ok := value.orig_return_types[0].derived.(^ast.Field); ok && len(field.names) > 0{
+ } else if field, ok := value.orig_return_types[0].derived.(^ast.Field); ok && len(field.names) > 0 {
add_parens = true
}