Skip to content

Commit

Permalink
fix: restore .v file endings for metadata/stubs
Browse files Browse the repository at this point in the history
reverts changes from 3c3b24a that were causing a regression
  • Loading branch information
ttytm committed Mar 30, 2024
1 parent 0077997 commit b451a1b
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 49 deletions.
22 changes: 11 additions & 11 deletions src/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.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/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/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.vv', .zlib)
files << $embed_file('stubs/c_decl.vv', .zlib)
files << $embed_file('stubs/errors.vv', .zlib)
files << $embed_file('stubs/threads.vv', .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)

return EmbedFS{
files: files
Expand Down
2 changes: 0 additions & 2 deletions src/metadata/stubs/arrays.vv → src/metadata/stubs/arrays.v
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pub:
// assert arr[2] == 0
// ```
len int

// cap field represent amount of memory space which has been reserved for elements,
// but not initialized or counted as elements
//
Expand All @@ -86,7 +85,6 @@ pub:
// arr_with_cap << 100 // no reallocation
// ```
cap int

// init field represent default initializer for each element.
//
// In `init` field, you can use special `index` variable to refer to the current index.
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.
15 changes: 1 addition & 14 deletions src/metadata/stubs/implicit.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,7 @@ module stubs
// Any is any type in code.
//
// It is needed to define all implicit methods of all types.
type Any = []Any
| bool
| f32
| f64
| i16
| i64
| i8
| int
| map[string]Any
| string
| u16
| u32
| u64
| u8
type Any = any

// 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 src/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.vv')
t.documentation_test('rendered', 'documentation/rendered.v')

return t
}
File renamed without changes.
40 changes: 20 additions & 20 deletions src/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.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')
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')

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.vv', .zlib)
$embed_file('stubs/arrays.v', .zlib)
--------------------------------------------------------------------------------

(source_file
Expand Down

0 comments on commit b451a1b

Please sign in to comment.