File size: 2,083 Bytes
d086025 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | # VIBE Examples
This directory contains example VIBE configuration files and usage examples.
## Valid Configuration Files
### simple.vibe
Basic VIBE file demonstrating core features:
- Simple key-value pairs
- Nested objects
- Arrays of scalar values
### config.vibe
Complex real-world configuration showing:
- Deep nesting
- Multiple data types
- Arrays and objects
- Comments
- Path-style values
### web_server.vibe
Web server configuration example with:
- Virtual hosts
- SSL configuration
- Logging settings
- Rate limiting
### database.vibe
Database configuration showing:
- Connection pooling
- Replica sets
- Migration settings
## Invalid Configuration Files (For Testing)
These files demonstrate what **NOT** to do in VIBE. They will fail to parse with helpful error messages.
### invalid_array_with_objects.vibe
❌ **Will fail**: Demonstrates why objects cannot be placed inside arrays
- Shows the common mistake of trying to create arrays of objects
- Includes the correct alternative using named objects
- Error: `"Objects cannot be placed inside arrays. Use named objects instead."`
### invalid_nested_arrays.vibe
❌ **Will fail**: Demonstrates why arrays cannot be nested
- Shows attempted multi-dimensional arrays
- Includes correct alternatives for different use cases
- Error: `"Arrays cannot be nested inside other arrays."`
**Why these restrictions?** See [The Stability Paradox](../docs/Stability_Paradox.md) for the design rationale. Arrays of objects create unstable configurations through index-based references, ambiguous merging, and lack of inherent identity. VIBE forces you to use named objects for stability.
## C Examples
### example.c
Complete working example showing how to:
- Parse VIBE files
- Access values using dot notation
- Handle errors
- Print configuration structure
## Running Examples
### Valid examples (will succeed):
### Invalid examples (will fail with error messages):
## Creating Your Own
1. Create a `.vibe` file with your configuration
2. Use the parser to load it
3. Access values with `vibe_get_*()` functions
|