From a4e85f8effd72f30e129ca6df2f92fad310bc1d8 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 15 Jul 2010 17:04:12 +0000 Subject: [PATCH 2/4] added comments to lexer git-svn-id: svn://anubis/fart/branches/parser-comments@293 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- parser/parser.lex | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/parser.lex b/parser/parser.lex index 8b7aa95..6b1ffc5 100644 --- a/parser/parser.lex +++ b/parser/parser.lex @@ -86,6 +86,7 @@ width return WIDTH; return IDENTIFIER; } +#.*\n yylloc->first_line++; yylloc->last_line++; \n yylloc->first_line++; yylloc->last_line++; [ \t\v] /* ignore whitespace */ From 01671e94861e9b48ff3f1aa492e974ab9d5418ab Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 15 Jul 2010 17:10:10 +0000 Subject: [PATCH 3/4] added vim syntax for comments, added sample comments to scene file git-svn-id: svn://anubis/fart/branches/parser-comments@294 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- scenes/shape-definitions.fart | 3 +++ vim/syntax/fart.vim | 2 ++ 2 files changed, 5 insertions(+) diff --git a/scenes/shape-definitions.fart b/scenes/shape-definitions.fart index 9b1c354..0cd0c1a 100644 --- a/scenes/shape-definitions.fart +++ b/scenes/shape-definitions.fart @@ -24,6 +24,7 @@ scene } } + # define a reusable Die type define shape Die subtract { union @@ -134,6 +135,7 @@ scene } } + # Define an individual stack of dies define shape DieStack union { 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 } } } + # Instantiate various DieStack objects translate <-5, 0, 0> { shape DieStack } translate <5, 0, 0> { rotate 90, <0, 0, 1> { shape DieStack } } translate <0, 5, 0> { rotate 180, <0, 0, 1> { shape DieStack } } diff --git a/vim/syntax/fart.vim b/vim/syntax/fart.vim index a11fdb5..a835a17 100644 --- a/vim/syntax/fart.vim +++ b/vim/syntax/fart.vim @@ -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 fartObjects box camera cyl extrude intersect light options plane scene shape sphere subtract union syn match fartNumber "\(^\|\W\)\@<=[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\=" +syn match fartComment "#.*" hi def link fartKeywords Operator hi def link fartObjects Type hi def link fartNumber Number +hi def link fartComment Comment let b:current_syntax = "fart" From 28382777acf998f52ebbc1532b5ebf139922bdc1 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 15 Jul 2010 17:10:54 +0000 Subject: [PATCH 4/4] updated .todo git-svn-id: svn://anubis/fart/branches/parser-comments@295 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- .todo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.todo b/.todo index b8cf91b..e96afbd 100644 --- a/.todo +++ b/.todo @@ -3,7 +3,7 @@ FART To-Do List High 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 Low Priority: