diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-19 15:15:48 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-19 15:15:48 +0200 |
| commit | 772d60c65246d252bda676aa09c371ad9985e2b7 (patch) | |
| tree | 03466d85173c25e0ed43e95f3cad5a9e35b71575 /src/common | |
| parent | 09fdb88a25c3cc350bc1256b2f48c5d5a297807e (diff) | |
move document struct back to server
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/ast.odin | 6 | ||||
| -rw-r--r-- | src/common/types.odin | 20 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/common/ast.odin b/src/common/ast.odin index 2b581c1..cb01c85 100644 --- a/src/common/ast.odin +++ b/src/common/ast.odin @@ -252,8 +252,10 @@ get_doc :: proc(comment: ^ast.Comment_Group, allocator: mem.Allocator) -> string } if tmp != "" { - replaced, allocated := strings.replace_all(tmp, "//", "", context.temp_allocator) - return strings.clone(replaced, allocator) + no_lines, _ := strings.replace_all(tmp, "//", "", context.temp_allocator) + no_begin_comments, _ := strings.replace_all(no_lines, "/*", "", context.temp_allocator) + no_end_comments, _ := strings.replace_all(no_begin_comments, "*/", "", context.temp_allocator) + return strings.clone(no_end_comments, allocator) } } diff --git a/src/common/types.odin b/src/common/types.odin index 231a42b..8481f50 100644 --- a/src/common/types.odin +++ b/src/common/types.odin @@ -23,25 +23,5 @@ WorkspaceFolder :: struct { uri: string, } -Package :: struct { - name: string, //the entire absolute path to the directory - base: string, -} - -Document :: struct { - uri: Uri, - fullpath: string, - text: []u8, - used_text: int, //allow for the text to be reallocated with more data than needed - client_owned: bool, - diagnosed_errors: bool, - ast: ast.File, - imports: []Package, - package_name: string, - allocator: ^Scratch_Allocator, //because parser does not support freeing I use arena allocators for each document - operating_on: int, //atomic - version: Maybe(int), -} - parser_warning_handler :: proc(pos: tokenizer.Pos, msg: string, args: ..any) { }
\ No newline at end of file |