Commit Graph

115 Commits

Author SHA1 Message Date
Alexander Larsson
c7cd1aeef5 Remove unused pyparsing_common 2020-01-17 16:38:42 +01:00
Alexander Larsson
27c7e3570b Its /usr/bin/env, not /bin/env on ubuntu 2020-01-17 16:27:40 +01:00
Alexander Larsson
6dfebf007b Fix dict assert 2020-01-17 14:38:03 +01:00
Alexander Larsson
61664457c0 Fix array peek() 2020-01-17 14:37:38 +01:00
Alexander Larsson
f0d64cdbc4 Generate peek() versions for arrays/dicts 2020-01-17 14:28:54 +01:00
Alexander Larsson
1e6fc128a5 Add basic type accessors for variants 2020-01-16 16:12:23 +01:00
Alexander Larsson
4f552dc3f3 Add variant_is_type() helper 2020-01-16 15:53:45 +01:00
Alexander Larsson
59e917e7fb fix error in internal validation 2020-01-16 15:15:21 +01:00
Alexander Larsson
a1b0148404 Add --internal-validation to do internal testing
This checks all (most) get_length() and get_child() calls compared to
what GVariant would have returned.
2020-01-16 15:12:01 +01:00
Alexander Larsson
a0be842eb6 Add missing variant functions 2020-01-15 16:50:25 +01:00
Alexander Larsson
c13bac0627 Drop _ref from all function names
This doesn't really bring anything.
2020-01-15 15:28:28 +01:00
Alexander Larsson
f4eddb6054 foo_ref_ref_to_variant => foo_ref_to_variant() 2020-01-15 15:03:07 +01:00
Alexander Larsson
7103aaba61 Return index in lookup too 2020-01-15 14:52:07 +01:00
Alexander Larsson
05c838a28b structs: Verify bounds 2020-01-15 14:27:02 +01:00
Alexander Larsson
ee8b6a92fb Add boundary checks to maybes 2020-01-15 13:35:07 +01:00
Alexander Larsson
7f4e572cd1 Check boundaries for dict elements 2020-01-15 13:20:34 +01:00
Alexander Larsson
867aa3b902 Validate array length and element positions 2020-01-15 12:13:23 +01:00
Alexander Larsson
45db667c3b Remove newlines at end of generated file 2020-01-15 11:52:30 +01:00
Alexander Larsson
9aed7c4909 Verify fixed size types are correct when creating from data 2020-01-15 11:50:11 +01:00
Alexander Larsson
4592372d3e Strip initial newlines in genC()
This allows us to do:
 C('''
some_code();
other_code();'');

Instead of:
 C(
'''some_code();
other_code();'');

Which makes the intentation a lot clearer
2020-01-15 11:40:28 +01:00
Alexander Larsson
dad69d7570 Verify type string in variant get_child() 2020-01-15 11:37:08 +01:00
Alexander Larsson
fb079b16b7 Add performance test 2020-01-14 13:24:57 +01:00
Alexander Larsson
626d814e15 Better errors for unknown types 2020-01-14 12:43:14 +01:00
Alexander Larsson
ad874c0ff4 Minor cleanup of generated code 2020-01-14 12:04:16 +01:00
Alexander Larsson
1fe7cc9c23 dict: Add binary searching lookup() for sorted keys 2020-01-14 11:54:07 +01:00
Alexander Larsson
d9c460d70e sample: Test some more corner cases in sorted metadata lookup 2020-01-14 11:53:43 +01:00
Alexander Larsson
6f9a7231dd sample: Test autogenerated typenames too 2020-01-14 11:38:17 +01:00
Alexander Larsson
0524d64088 sample: Test sorted dict lookups as well as non-sorted 2020-01-14 11:35:45 +01:00
Alexander Larsson
297be235f8 Dict: Add sorted attribute 2020-01-14 11:35:21 +01:00
Alexander Larsson
d0a5901fb2 dicts: Specialize the dict lookup() functions
Since we're looping over all elements we can do better than
calling get_at().
2020-01-14 10:33:00 +01:00
Alexander Larsson
057c7bb370 Fix sample test by enabling deep formating 2020-01-14 09:55:22 +01:00
Alexander Larsson
599bbc96f0 Use unique types instead of typedefs to get type safety 2020-01-13 16:38:13 +01:00
Alexander Larsson
2f9a961fce Create README.md 2020-01-13 16:28:58 +01:00
Alexander Larsson
9e6ac054d9 Renambe to variant-schema-compiler 2020-01-13 15:44:23 +01:00
Alexander Larsson
8dac5ebb4b ostree-test also handle dirtree and summary 2020-01-13 15:35:23 +01:00
Alexander Larsson
b8959d4ff6 Add gitignore 2020-01-13 14:45:53 +01:00
Alexander Larsson
1cb3b48a94 Add ostree testing code 2020-01-13 14:45:00 +01:00
Alexander Larsson
547b69b665 Default to shallow print 2020-01-13 14:43:35 +01:00
Alexander Larsson
353f14d34f Handle empty non-fixed-element array lengths 2020-01-13 14:43:14 +01:00
Alexander Larsson
e2fe9c0805 Add _from_bytes and _from_data for types 2020-01-13 14:42:46 +01:00
Alexander Larsson
0651cb2717 clean up ostree sample 2020-01-13 14:20:59 +01:00
Alexander Larsson
693178f67e Fix output coding style 2020-01-13 14:20:41 +01:00
Alexander Larsson
347deb4e82 Fix up generated indentation 2020-01-13 14:03:34 +01:00
Alexander Larsson
87904050a3 Support endian attributes 2020-01-13 13:55:22 +01:00
Alexander Larsson
8b2c465f02 Add peek_as_variant and ref_to_variant for all types 2020-01-13 13:27:26 +01:00
Alexander Larsson
646a5296e7 Generate peeking struct accessors for fixed and arrays of fixed 2020-01-13 13:21:13 +01:00
Alexander Larsson
2b4a342287 as_variant, not as_gvariant 2020-01-13 12:55:31 +01:00
Alexander Larsson
5635fb83a8 Generate fixed structs 2020-01-13 12:47:32 +01:00
Alexander Larsson
3a5cb153fb update TODO 2020-01-13 12:09:01 +01:00
Alexander Larsson
c376930900 Generate entry typedef with other types 2020-01-13 12:08:02 +01:00