merged in parser-comments branch

git-svn-id: svn://anubis/fart/trunk@296 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2010-07-15 17:15:45 +00:00
commit 42c669fe4a
4 changed files with 7 additions and 1 deletions

2
.todo
View File

@ -3,7 +3,7 @@ FART To-Do List
High Priority: High Priority:
Medium Priority: Medium Priority:
- Scene file pre-parser to allow includes, macros, and comments - Scene file pre-parser to allow includes / macros
- Add spotlight and directional light types - Add spotlight and directional light types
Low Priority: Low Priority:

View File

@ -86,6 +86,7 @@ width return WIDTH;
return IDENTIFIER; return IDENTIFIER;
} }
#.*\n yylloc->first_line++; yylloc->last_line++;
\n yylloc->first_line++; yylloc->last_line++; \n yylloc->first_line++; yylloc->last_line++;
[ \t\v] /* ignore whitespace */ [ \t\v] /* ignore whitespace */

View File

@ -24,6 +24,7 @@ scene
} }
} }
# define a reusable Die type
define shape Die subtract define shape Die subtract
{ {
union union
@ -134,6 +135,7 @@ scene
} }
} }
# Define an individual stack of dies
define shape DieStack union define shape DieStack union
{ {
translate <0, 0, 1.5> { scale 3 { shape Die } } translate <0, 0, 1.5> { scale 3 { shape Die } }
@ -141,6 +143,7 @@ scene
translate <0, 0, 5.5> { rotate 90, <0, 1, 0> { shape Die } } translate <0, 0, 5.5> { rotate 90, <0, 1, 0> { shape Die } }
} }
# Instantiate various DieStack objects
translate <-5, 0, 0> { shape DieStack } translate <-5, 0, 0> { shape DieStack }
translate <5, 0, 0> { rotate 90, <0, 0, 1> { shape DieStack } } translate <5, 0, 0> { rotate 90, <0, 0, 1> { shape DieStack } }
translate <0, 5, 0> { rotate 180, <0, 0, 1> { shape DieStack } } translate <0, 5, 0> { rotate 180, <0, 0, 1> { shape DieStack } }

View File

@ -13,9 +13,11 @@ syn case match
syn keyword fartKeywords ambient ambient_occlusion color define diffuse exposure height jitter look_at material max_depth multisample ngon offset polygon position radius reflectance rotate scale shininess size specular translate transparency union up vfov width syn keyword fartKeywords ambient ambient_occlusion color define diffuse exposure height jitter look_at material max_depth multisample ngon offset polygon position radius reflectance rotate scale shininess size specular translate transparency union up vfov width
syn keyword fartObjects box camera cyl extrude intersect light options plane scene shape sphere subtract union syn keyword fartObjects box camera cyl extrude intersect light options plane scene shape sphere subtract union
syn match fartNumber "\(^\|\W\)\@<=[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\=" syn match fartNumber "\(^\|\W\)\@<=[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\="
syn match fartComment "#.*"
hi def link fartKeywords Operator hi def link fartKeywords Operator
hi def link fartObjects Type hi def link fartObjects Type
hi def link fartNumber Number hi def link fartNumber Number
hi def link fartComment Comment
let b:current_syntax = "fart" let b:current_syntax = "fart"