"path" raises syntax error

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
TorfusPolymorphus
Posts: 27
Joined: Sun Dec 28, 2008 2:16 pm
Contact:

"path" raises syntax error

Post by TorfusPolymorphus »

I have a problem using paths. The following file (with a path taken from the docs)

Code: Select all

startshape trill

path trill {
  // no parentheses required
  MOVETO {x cos(234) y sin(234)}
  5* {r -144}   // ditto
    // parentheses required because of
    // addition
    CURVETO {x 0 y 1 
             x1 (cos(234) + cos(324)) 
             y1 (sin(234) + sin(324)) 
             x2 1 y2 1}
  CLOSEPOLY {p align}
  FILL {p evenodd}
  STROKE {p roundjoin a -0.5}
}
raises a syntax error:

Code: Select all

$ cfdg test.cfdg  output.png && xview output.png 
Reading rules file test.cfdg                            
Line 3: Parse error - syntax error
I am running CFDG 2.1(v7) on Linux. What am I doing wrong? Thanks for any pointers!

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Paths only work in v2.2, which is currently in beta. Get it here.

User avatar
TorfusPolymorphus
Posts: 27
Joined: Sun Dec 28, 2008 2:16 pm
Contact:

Post by TorfusPolymorphus »

Thanks! I guess it would be nice if the docs would tell you in which version the corresponding feature was introduced :D

Post Reply