samppah / com.kmaki.vader.xrnx

1 stars 0 forks source link

descriptive syntax error #10

Open samppah opened 10 years ago

samppah commented 10 years ago

Find out how to do this with lulpeg parsing

samppah commented 10 years ago

A big question is how to separate optional message parts from failed message parts. If a msg part is optional, a match for it will fail. This is also true if the msg part is invalid. ---> ??? Maybe set up a has_target, has_content, has_globalflags, has_macro globals-frame. When it is deduced in the parse that one of these is being input, set the flag up. Modify the Err() function so that it accepts a flag: Err("msg", has_target). If the flag is not up, don't fire the error. Otherwise fire the error. Hmm. Funky.

samppah commented 10 years ago

This should most likely use the set_context() -function or something resembling that. Track and collect passed matches and when an error fires, it's known where (note to self, add Cp to set_context) and why the error was fired. When parse returns failed, pass the collected data to error.