New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An extra brace (curly bracket) or parenthesis at the top level , will terminate umple code processing #2023
Comments
An extra opening brace has the same effect. Adding a grammar rule (and processing in UmpleInternalParser_CodeClass.ump) to catch an loose braces and raise new error messages (e.g. 1504) at the top level seemed to have no effect, yet broke certain code in the RealTimeCPP generator. Perhaps the answer would be to determine if there are characters not processed beyond the end of parsing, and if so raise an error message. |
we discovered that any { or } or {} ot () or ( or ) will terminate processing I suggest trying to match these using a regex in line 14 of umple_core.grammar and then detecting that in class/UmpleInternalParser_CodeClass.ump and calling setFailedPosition with a new warning in en.error We already added the message to branch issue2023curlybracket so use that branch |
I give a 60% chance that we could follow the following approach.
If that doesn't work, we may have to dig deeper. |
New suggestion: Look for malformedStatement processing in the umple_exceptions.grammar. Consider the extra brackets as a new type of maformed statement. Create a regex to match, and then process the resulting rule (which would be near class/UmpleInternalParser_CodeClass.ump:5640: ... note that all you need to do is to output a warning) |
Created PR which detects open and close (round and curly brackets). Next step is to create test cases and write the user manual for the warning. |
The new PR merged has the following information: PR #2049This code currently raises a warning and detects the following Extra Brackets:
In order to remove the warning, the user would need to look at the warning message showing the line number of the extra bracket. NoteFor Developers, Quick Build the Compiler twice as there is an edit in the Umple Internal Parser Code. |
In the following example
... the extra closing brace will terminate all subsequent processing of input. That means that if anyone accidentally has one more closing brace than opening one at any point in their code, then code will be ignored and this may be very hard to debug.
Somehow the parser should detect the extra closing brace and raise an error message at that point.
The text was updated successfully, but these errors were encountered: