Add text-DSL parser with line-numbered errors
Two-pass-free line-based scanner. Each directive carries its source line so downstream validation errors can be attributed correctly. Parser checks syntax only — atlas/tile resolution and bounds checks are deferred to the builder so each tier has one responsibility.
This commit is contained in:
4
tests/fixtures/dsl/error_oob.txt
vendored
Normal file
4
tests/fixtures/dsl/error_oob.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
size 4 4
|
||||
atlas atlas_a
|
||||
layer surface
|
||||
set 10 10 atlas_a:grass
|
||||
16
tests/fixtures/dsl/full.txt
vendored
Normal file
16
tests/fixtures/dsl/full.txt
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# full demo with comments and rotation
|
||||
id full_demo
|
||||
size 4 4
|
||||
atlas atlas_a
|
||||
atlas atlas_b
|
||||
|
||||
layer surface
|
||||
fill 0 0 3 3 atlas_a:grass
|
||||
set 1 1 atlas_a:stone rot 2
|
||||
|
||||
layer wall
|
||||
set 0 0 atlas_b:water rot 1
|
||||
|
||||
roof
|
||||
set 1 1 1
|
||||
set 2 2 0
|
||||
4
tests/fixtures/dsl/minimal.txt
vendored
Normal file
4
tests/fixtures/dsl/minimal.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
size 4 4
|
||||
atlas atlas_a
|
||||
layer surface
|
||||
set 0 0 atlas_a:grass
|
||||
Reference in New Issue
Block a user