How to allow ( ) in func parameters ?
Posted: 27.12.2015 17:31
I have the following OpenSCAD code:
I was able to make a foldable for it with a common symbol parser [\{\},\<\>;\#\(\)\[\]=\.\*\+\$-\?/&] and 2 rules:
However, it fails when a (..) is given in the function parameter:
How could I make it to work ?
Code: Select all
function f1( c,d=0,k=[] )=
<statements>
;
Code: Select all
rule_func<id>(..)=...
0 Equal <symbol> =
1 Equal <symbol> )
2 Skip < all tokens >
3 Equal <symbol> (
4 Equal <Identifier>
5 Equal <Identifier> function
rule_;
0 Equal <symbol> ;
Code: Select all
function f1( c,d=0,k=[]
, a=get(3) // <====== the ( ) causes it to fail
)=
<statements>
;