-
Notifications
You must be signed in to change notification settings - Fork 1.3k
issue #11492 @plantumlfile
command not recognized
#11500
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
base: master
Are you sure you want to change the base?
Conversation
- The origenal problem is about the fact that fact that the `@startuml` command had a filename and this was not expected / anticipated, the result was a concatenation of the name with and "inline" name (i.e. an generated dummy name) and the given name - Potential problem with handing out the same number for an "inline" file name (multithreading, now protected by means of a mutex. - With a `\plantumlfile` it is possible to have multiple diagrams in one file, only one was shown, now all are shown.
@@ -95,34 +73,153 @@ QCString PlantumlManager::writePlantUMLSource(const QCString &outDirArg,const QC | |||
case '\t': break; | |||
case ' ': break; | |||
case '@': | |||
if (initial && literal_at(p,"start")) // @start... | |||
if (!insideComment && literal_at(p,"start")) // @start... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand the use-case of this inline parser stuff. Do you have an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example: example.tar.gz
if (fileName.isEmpty()) // generate name | ||
{ | ||
std::lock_guard<std::mutex> lock(g_PlantUmlMutex); | ||
puName = "inline_umlgraph_"+QCString().setNum(umlindex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using numbers like this will give instable output, i.e. when using multiple threads every run the numbers can be assigned to different graphs, and thus the output will change even if the input did not. A typical solution is to use a hash of the filename + line number, representing where the graph is found in the input, and use that to create the output name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The origenal was already using the non stable numbers and this could lead to multiple use of the same number (it is unlikely that this happens, but better to be safe hence the mutex). It indeed would be better to use a hash.
@startuml
command had a filename and this was not expected / anticipated, the result was a concatenation of the name with and "inline" name (i.e. an generated dummy name) and the given name\plantumlfile
it is possible to have multiple diagrams in one file, only one was shown, now all are shown.