From f3ae68925dd376307ada3e223661daf4bdbc84da Mon Sep 17 00:00:00 2001 From: Dylan Donnell Date: Fri, 27 Dec 2024 12:27:52 +0000 Subject: [PATCH 1/6] fix: update v keywords list --- src/c2v.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/c2v.v b/src/c2v.v index d908b18..e283ea9 100644 --- a/src/c2v.v +++ b/src/c2v.v @@ -13,8 +13,7 @@ import datatypes const version = '0.4.1' // V keywords, that are not keywords in C: -const v_keywords = ['go', 'type', 'true', 'false', 'module', 'byte', 'in', 'none', 'map', 'string', - 'spawn', 'shared', 'select', 'as', 'fn'] +const v_keywords = ['as', 'asm', 'assert', 'atomic', 'break', 'const', 'continue', 'defer', 'else', 'enum', 'false', 'fn', 'for', 'go', 'goto', 'if', 'implements', 'import', 'in', 'interface', 'is', 'isreftype', 'lock', 'match', 'module', 'mut', 'none', 'or', 'pub', 'return', 'rlock', 'select', 'shared', 'sizeof', 'spawn', 'static', 'struct', 'true', 'type', 'typeof', 'union', 'unsafe', 'volatile', '__global', '__offsetof'] // libc fn definitions that have to be skipped (V already knows about them): const builtin_fn_names = ['fopen', 'puts', 'fflush', 'getline', 'printf', 'memset', 'atoi', 'memcpy', From 774653d8ad0edbd6c8654e1d03f105c9474af810 Mon Sep 17 00:00:00 2001 From: Dylan Donnell Date: Fri, 27 Dec 2024 12:41:34 +0000 Subject: [PATCH 2/6] chore: v fmt -w . --- src/c2v.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/c2v.v b/src/c2v.v index e283ea9..d20dffb 100644 --- a/src/c2v.v +++ b/src/c2v.v @@ -13,7 +13,11 @@ import datatypes const version = '0.4.1' // V keywords, that are not keywords in C: -const v_keywords = ['as', 'asm', 'assert', 'atomic', 'break', 'const', 'continue', 'defer', 'else', 'enum', 'false', 'fn', 'for', 'go', 'goto', 'if', 'implements', 'import', 'in', 'interface', 'is', 'isreftype', 'lock', 'match', 'module', 'mut', 'none', 'or', 'pub', 'return', 'rlock', 'select', 'shared', 'sizeof', 'spawn', 'static', 'struct', 'true', 'type', 'typeof', 'union', 'unsafe', 'volatile', '__global', '__offsetof'] +const v_keywords = ['as', 'asm', 'assert', 'atomic', 'break', 'const', 'continue', 'defer', 'else', + 'enum', 'false', 'fn', 'for', 'go', 'goto', 'if', 'implements', 'import', 'in', 'interface', + 'is', 'isreftype', 'lock', 'match', 'module', 'mut', 'none', 'or', 'pub', 'return', 'rlock', + 'select', 'shared', 'sizeof', 'spawn', 'static', 'struct', 'true', 'type', 'typeof', 'union', + 'unsafe', 'volatile', '__global', '__offsetof'] // libc fn definitions that have to be skipped (V already knows about them): const builtin_fn_names = ['fopen', 'puts', 'fflush', 'getline', 'printf', 'memset', 'atoi', 'memcpy', From 184d5bd440835096b1665669a63e52a6c6a7ee40 Mon Sep 17 00:00:00 2001 From: Dylan Donnell Date: Fri, 27 Dec 2024 13:13:57 +0000 Subject: [PATCH 3/6] feat: remove c89/99 keywords --- src/c2v.v | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/c2v.v b/src/c2v.v index d20dffb..b1fd573 100644 --- a/src/c2v.v +++ b/src/c2v.v @@ -13,11 +13,10 @@ import datatypes const version = '0.4.1' // V keywords, that are not keywords in C: -const v_keywords = ['as', 'asm', 'assert', 'atomic', 'break', 'const', 'continue', 'defer', 'else', - 'enum', 'false', 'fn', 'for', 'go', 'goto', 'if', 'implements', 'import', 'in', 'interface', - 'is', 'isreftype', 'lock', 'match', 'module', 'mut', 'none', 'or', 'pub', 'return', 'rlock', - 'select', 'shared', 'sizeof', 'spawn', 'static', 'struct', 'true', 'type', 'typeof', 'union', - 'unsafe', 'volatile', '__global', '__offsetof'] +const v_keywords = ['as', 'asm', 'assert', 'atomic', 'defer', 'false', 'fn', 'go', 'implements', + 'import', 'in', 'interface', 'is', 'isreftype', 'lock', 'match', 'map', 'module', 'mut', 'none', + 'or', 'pub', 'rlock', 'select', 'shared', 'spawn', 'string', 'true', 'type', 'typeof', 'unsafe', + '__global', '__offsetof'] // libc fn definitions that have to be skipped (V already knows about them): const builtin_fn_names = ['fopen', 'puts', 'fflush', 'getline', 'printf', 'memset', 'atoi', 'memcpy', From f0fed236c32564b96f9aa1ac7fbceeb65ca3de80 Mon Sep 17 00:00:00 2001 From: Dylan Donnell Date: Fri, 27 Dec 2024 19:50:22 +0000 Subject: [PATCH 4/6] feat: add missing v keywords not found in docs --- src/c2v.v | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/c2v.v b/src/c2v.v index b1fd573..3c8676f 100644 --- a/src/c2v.v +++ b/src/c2v.v @@ -13,10 +13,12 @@ import datatypes const version = '0.4.1' // V keywords, that are not keywords in C: -const v_keywords = ['as', 'asm', 'assert', 'atomic', 'defer', 'false', 'fn', 'go', 'implements', - 'import', 'in', 'interface', 'is', 'isreftype', 'lock', 'match', 'map', 'module', 'mut', 'none', - 'or', 'pub', 'rlock', 'select', 'shared', 'spawn', 'string', 'true', 'type', 'typeof', 'unsafe', - '__global', '__offsetof'] +const v_keywords = ['!in', '!is', '__global', '__offsetof', 'as', 'asm', 'assert', 'atomic', 'bool', + 'byte', 'defer', 'dump', 'f32', 'f64', 'false', 'fn', 'go', 'i16', 'i64', 'i8', 'implements', + 'import', 'in', 'interface', 'is', 'isize', 'isreftype', 'lock', 'map', 'match', 'module', + 'mut', 'nil', 'none', 'or', 'pub', 'rlock', 'rune', 'select', 'shared', 'spawn', 'string', + 'struct', 'thread', 'true', 'type', 'typeof', 'u16', 'u32', 'u64', 'u8', 'unsafe', 'usize', + 'voidptr'] // libc fn definitions that have to be skipped (V already knows about them): const builtin_fn_names = ['fopen', 'puts', 'fflush', 'getline', 'printf', 'memset', 'atoi', 'memcpy', From de4e82000420713d89a9ff5ae019b307b80f3260 Mon Sep 17 00:00:00 2001 From: Dylan Donnell Date: Fri, 27 Dec 2024 19:56:03 +0000 Subject: [PATCH 5/6] fix: remove types from keywords list --- src/c2v.v | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/c2v.v b/src/c2v.v index 3c8676f..9933d46 100644 --- a/src/c2v.v +++ b/src/c2v.v @@ -14,11 +14,10 @@ const version = '0.4.1' // V keywords, that are not keywords in C: const v_keywords = ['!in', '!is', '__global', '__offsetof', 'as', 'asm', 'assert', 'atomic', 'bool', - 'byte', 'defer', 'dump', 'f32', 'f64', 'false', 'fn', 'go', 'i16', 'i64', 'i8', 'implements', - 'import', 'in', 'interface', 'is', 'isize', 'isreftype', 'lock', 'map', 'match', 'module', - 'mut', 'nil', 'none', 'or', 'pub', 'rlock', 'rune', 'select', 'shared', 'spawn', 'string', - 'struct', 'thread', 'true', 'type', 'typeof', 'u16', 'u32', 'u64', 'u8', 'unsafe', 'usize', - 'voidptr'] + 'byte', 'defer', 'dump', 'false', 'fn', 'go', 'implements', 'import', 'in', 'interface', 'is', + 'isize', 'isreftype', 'lock', 'map', 'match', 'module', 'mut', 'nil', 'none', 'or', 'pub', + 'rlock', 'rune', 'select', 'shared', 'spawn', 'string', 'struct', 'thread', 'true', 'type', + 'typeof', 'unsafe', 'usize', 'voidptr'] // libc fn definitions that have to be skipped (V already knows about them): const builtin_fn_names = ['fopen', 'puts', 'fflush', 'getline', 'printf', 'memset', 'atoi', 'memcpy', From 6df5897a78b0b60aeb44ee9f7284fd5163393616 Mon Sep 17 00:00:00 2001 From: Dylan Donnell Date: Fri, 27 Dec 2024 22:51:16 +0000 Subject: [PATCH 6/6] review --- src/c2v.v | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/c2v.v b/src/c2v.v index 9933d46..6a1615b 100644 --- a/src/c2v.v +++ b/src/c2v.v @@ -13,11 +13,11 @@ import datatypes const version = '0.4.1' // V keywords, that are not keywords in C: -const v_keywords = ['!in', '!is', '__global', '__offsetof', 'as', 'asm', 'assert', 'atomic', 'bool', - 'byte', 'defer', 'dump', 'false', 'fn', 'go', 'implements', 'import', 'in', 'interface', 'is', - 'isize', 'isreftype', 'lock', 'map', 'match', 'module', 'mut', 'nil', 'none', 'or', 'pub', - 'rlock', 'rune', 'select', 'shared', 'spawn', 'string', 'struct', 'thread', 'true', 'type', - 'typeof', 'unsafe', 'usize', 'voidptr'] +const v_keywords = ['__global', '__offsetof', 'as', 'asm', 'assert', 'atomic', 'bool', 'byte', + 'defer', 'dump', 'false', 'fn', 'go', 'implements', 'import', 'in', 'interface', 'is', 'isize', + 'isreftype', 'lock', 'map', 'match', 'module', 'mut', 'nil', 'none', 'or', 'pub', 'rlock', + 'rune', 'select', 'shared', 'spawn', 'string', 'struct', 'thread', 'true', 'type', 'typeof', + 'unsafe', 'usize', 'voidptr'] // libc fn definitions that have to be skipped (V already knows about them): const builtin_fn_names = ['fopen', 'puts', 'fflush', 'getline', 'printf', 'memset', 'atoi', 'memcpy',