Skip to content

Commit

Permalink
chore: use .vv extension for meta- and testdata files (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Mar 25, 2024
1 parent 609d66a commit 3c3b24a
Show file tree
Hide file tree
Showing 54 changed files with 49 additions and 36 deletions.
2 changes: 1 addition & 1 deletion editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"watch": "tsc -watch -p ./",
"package": "npx vsce package",
"postpackage": "node ./scripts/minify_json.js --restore",
"testgrammar": "vscode-tmgrammar-test -g syntaxes/v.tmLanguage.json \"syntaxes/tests/*.v\"",
"testgrammar": "vscode-tmgrammar-test -g syntaxes/v.tmLanguage.json \"syntaxes/tests/*.vv\"",
"format": "prettier --write \"scripts/**/*.js\" \"src/**/*.ts\""
},
"main": "dist/extension.js",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions metadata/metadata.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ pub fn (e &EmbedFS) unpack_to(path string) ! {

pub fn embed_fs() EmbedFS {
mut files := []embed_file.EmbedFileData{}
files << $embed_file('stubs/arrays.v', .zlib)
files << $embed_file('stubs/primitives.v', .zlib)
files << $embed_file('stubs/vweb.v', .zlib)
files << $embed_file('stubs/compile_time_constants.v', .zlib)
files << $embed_file('stubs/compile_time_reflection.v', .zlib)
files << $embed_file('stubs/builtin_compile_time.v', .zlib)
files << $embed_file('stubs/channels.v', .zlib)
files << $embed_file('stubs/arrays.vv', .zlib)
files << $embed_file('stubs/primitives.vv', .zlib)
files << $embed_file('stubs/vweb.vv', .zlib)
files << $embed_file('stubs/compile_time_constants.vv', .zlib)
files << $embed_file('stubs/compile_time_reflection.vv', .zlib)
files << $embed_file('stubs/builtin_compile_time.vv', .zlib)
files << $embed_file('stubs/channels.vv', .zlib)
files << $embed_file('stubs/attributes/Deprecated.v', .zlib)
files << $embed_file('stubs/attributes/Table.v', .zlib)
files << $embed_file('stubs/attributes/Attribute.v', .zlib)
Expand All @@ -43,10 +43,10 @@ pub fn embed_fs() EmbedFS {
files << $embed_file('stubs/attributes/Noreturn.v', .zlib)
files << $embed_file('stubs/attributes/Manualfree.v', .zlib)
files << $embed_file('stubs/implicit.v', .zlib)
files << $embed_file('stubs/compile_time.v', .zlib)
files << $embed_file('stubs/c_decl.v', .zlib)
files << $embed_file('stubs/errors.v', .zlib)
files << $embed_file('stubs/threads.v', .zlib)
files << $embed_file('stubs/compile_time.vv', .zlib)
files << $embed_file('stubs/c_decl.vv', .zlib)
files << $embed_file('stubs/errors.vv', .zlib)
files << $embed_file('stubs/threads.vv', .zlib)

return EmbedFS{
files: files
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 14 additions & 1 deletion metadata/stubs/implicit.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ module stubs
// Any is any type in code.
//
// It is needed to define all implicit methods of all types.
type Any = any
type Any = []Any
| bool
| f32
| f64
| i16
| i64
| i8
| int
| map[string]Any
| string
| u16
| u32
| u64
| u8

// str returns a string representation of the type.
//
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/language_server.v
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub mut:
// stubs_version incremented on each change in stubs
//
// See also `LanguageServer.setup_stubs()`
stubs_version int = 1
stubs_version int = 2
// initialization_options is a list of custom initialization options.
// Used to pass custom options in tests.
initialization_options []string
Expand Down
2 changes: 1 addition & 1 deletion tests/documentation.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import testing
fn documentation() testing.Tester {
mut t := testing.with_name('documentation')

t.documentation_test('rendered', 'documentation/rendered.v')
t.documentation_test('rendered', 'documentation/rendered.vv')

return t
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 20 additions & 20 deletions tests/types.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import testing
fn types() testing.Tester {
mut t := testing.with_name('types')

t.type_test('literals', 'types/literals.v')
t.type_test('parameters types', 'types/parameters.v')
t.type_test('call expressions', 'types/call_expression.v')
t.type_test('type initializer', 'types/type_initializer.v')
t.type_test('for loops', 'types/for_loops.v')
t.type_test('slice and index expression', 'types/slice_and_index_expression.v')
t.type_test('function literal', 'types/function_literal.v')
t.type_test('pointers', 'types/pointers.v')
t.type_test('bool operators', 'types/bool_operators.v')
t.type_test('unsafe expression', 'types/unsafe_expression.v')
t.type_test('if expression', 'types/if_expression.v')
t.type_test('match expression', 'types/match_expression.v')
t.type_test('map init expression', 'types/map_init_expression.v')
t.type_test('chan type', 'types/chan_type.v')
t.type_test('struct fields', 'types/fields.v')
t.type_test('receiver', 'types/receiver.v')
t.type_test('json decode', 'types/json_decode.v')
t.type_test('generics', 'types/generics.v')
t.type_test('constants', 'types/constants.v')
t.type_test('for loop', 'types/for_loop.v')
t.type_test('literals', 'types/literals.vv')
t.type_test('parameters types', 'types/parameters.vv')
t.type_test('call expressions', 'types/call_expression.vv')
t.type_test('type initializer', 'types/type_initializer.vv')
t.type_test('for loops', 'types/for_loops.vv')
t.type_test('slice and index expression', 'types/slice_and_index_expression.vv')
t.type_test('function literal', 'types/function_literal.vv')
t.type_test('pointers', 'types/pointers.vv')
t.type_test('bool operators', 'types/bool_operators.vv')
t.type_test('unsafe expression', 'types/unsafe_expression.vv')
t.type_test('if expression', 'types/if_expression.vv')
t.type_test('match expression', 'types/match_expression.vv')
t.type_test('map init expression', 'types/map_init_expression.vv')
t.type_test('chan type', 'types/chan_type.vv')
t.type_test('struct fields', 'types/fields.vv')
t.type_test('receiver', 'types/receiver.vv')
t.type_test('json decode', 'types/json_decode.vv')
t.type_test('generics', 'types/generics.vv')
t.type_test('constants', 'types/constants.vv')
t.type_test('for loop', 'types/for_loop.vv')

return t
}
2 changes: 1 addition & 1 deletion tree_sitter_v/test/corpus/compile_time.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
================================================================================
Compile-time call expression
================================================================================
$embed_file('stubs/arrays.v', .zlib)
$embed_file('stubs/arrays.vv', .zlib)
--------------------------------------------------------------------------------

(source_file
Expand Down

0 comments on commit 3c3b24a

Please sign in to comment.