Skip to content
Snippets Groups Projects
Commit b2059db3 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Merge branch 'patches/autodoc-value-parser' into 8.0

* patches/autodoc-value-parser:
  Tools.AutoDoc.DocParser: Improved error handling for @value.
parents 85ad27d3 fbc40acc
No related branches found
No related tags found
No related merge requests found
...@@ -459,9 +459,13 @@ protected class DocParserClass { ...@@ -459,9 +459,13 @@ protected class DocParserClass {
return t->xml(); return t->xml();
} }
protected string valueArgHandler(string keyword, string arg) { protected string valueArgHandler(string keyword, string arg)
{
// werror("This is the @value arg handler "); // werror("This is the @value arg handler ");
catch {
// NB: Throws errors on some syntax errors.
.PikeParser parser = .PikeParser(arg, currentPosition); .PikeParser parser = .PikeParser(arg, currentPosition);
// werror("&&& %O\n", arg); // werror("&&& %O\n", arg);
string s = parser->parseLiteral() || parser->parseIdents(); string s = parser->parseLiteral() || parser->parseIdents();
string s2 = 0; string s2 = 0;
...@@ -481,7 +485,8 @@ protected class DocParserClass { ...@@ -481,7 +485,8 @@ protected class DocParserClass {
else else
if (s2) if (s2)
return xmltag("maxvalue", xmlquote(s2)); return xmltag("maxvalue", xmlquote(s2));
else };
parseError("@value: expected identifier or literal constant, got %O", arg); parseError("@value: expected identifier or literal constant, got %O", arg);
return ""; return "";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment