well the quick reason is that anyone using my script is already familiar with php, AND I hate having to learn one more thing I have to store in my brain. (Just to get the point across, I'm going to write the rest of this post in Lithuanian 🙂
the other issue is, I want to retain a) the comments both //this type and #this type and / this type / inline. What I really need is something that returned an array like this:
array(
array(
'node'=>'asdf',
'start'=>135,
'stop'=>178,
'valuestart'=>142,
'valuestop'=>170,
),
array(
etc.
),
),
where node=the name of the array node, and 135-178 represents the entire "chunk" of coding, and also valuestart and valuestop may (alternately) represent the expanse of the string value. With these numbers I can snip out, modify, and re-insert code string and theoretically keep the comments and existing indentation.
consider phpMyAdmin, haven't looked but they must have a mighty fine SQL parser to be able to submit a gazillion sql queries in a textarea and process it; you know they've got to split each one up with a semicolon.
the goal here is to access user- written code via a textarea OR via a form defining options, and have the form defining options minimally effect what the user wrote, if present.
What I thought was, maybe someone has a function that would produce that mapping array like I showed above.