concordion / concordion-excel-extension

Allows Concordion specifications to be in Excel format rather than HTML
Other
9 stars 12 forks source link

strict comment syntax #16

Open vgheo opened 5 years ago

vgheo commented 5 years ago

The current implementation of the parser for excel comments is a handcrafted parser that tolerates (ignores) free-text comments mixed with concordion syntax.

As a consequence, errors in the excel/concordion comments propagate to the intermediate html and are reported as errors at that level, with no traceability to the excel source location. This makes debugging of syntax issues very tedious. Examples:

As an enhancement, the following is proposed

vgheo commented 5 years ago

Survey of parsers with Java: https://dzone.com/articles/parsing-in-java-part-2-diving-into-cfg-parsers https://dzone.com/articles/parsing-in-java-part-3-diving-into-peg-parsers

robmoffat commented 5 years ago

I think you’re right that error handling is less than perfect.

The problem is that the conversion leaves none of the context of where the errors exist in the spreadsheet. Is that correct? I’m a bit hazy on this now as I haven’t used it in a while

I’m not entirely sure how using a grammar would fix this?

vgheo commented 5 years ago

I see several problems.

Considering all errors that can occur in a concordion/excel specification, these can be categorized as follows: A. excel comment syntax errors

B. excel to html translation errors

C. html syntax errors

D. Concordion execution errors

I could consider contributing a solution, if you agree in principle that the enhacement makes sense and maybe provide some guidance.

robmoffat commented 5 years ago

This is excellent analysis, thanks.

Regarding (A), you could go down that route, but it might actually be less effort to just ruggedise the existing code. The coverage isn't wonderful at the moment:

Screenshot 2019-09-15 at 20 17 17

(B) we discussed in #15 the exception handing (and debuggability of the html generally) could be improved by included information about where the HTML came from. Would that help with (D) too?