From 8a5cdc3fa6ffaf41d4c970ec988bed4dadcf55d4 Mon Sep 17 00:00:00 2001 From: alfred Date: Thu, 24 Aug 2006 03:02:29 +0000 Subject: [PATCH] modify critic git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1375 6f19259b-4bc3-4df7-8a09-765794883524 --- .../org/tianocore/migration/Critic.java | 82 ++++++++++--------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java b/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java index c737c31403..881d3aae2c 100644 --- a/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java +++ b/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java @@ -54,45 +54,49 @@ public final class Critic { } else if (line.matches("\\*\\*\\/")) { incomment = false; templine.append(line + "\n"); - } else if (incomment && line.contains("Routine Description:")) { - description = true; - arguments = false; - returns = false; - } else if (incomment && line.contains("Arguments:")) { - description = false; - arguments = true; - returns = false; - } else if (incomment && line.contains("Returns:")) { - description = false; - arguments = false; - returns = true; - } else if (incomment && description) { - templine.append(" " + line.trim() + "\n"); - } else if (incomment && arguments) { - mtrcommentequation = ptncommentequation.matcher(line); - if (mtrcommentequation.find()) { - inequation = true; - templine.append(" @param " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n"); - } else if (inequation && line.trim().length() == 0) { - inequation = false; - templine.append(line + "\n"); - } else if (inequation && line.trim().length() != 0) { - templine.append("#%#%" + line + "\n"); - } else { - templine.append(" " + line.trim() + "\n"); - } - } else if (incomment && returns) { - mtrcommentequation = ptncommentequation.matcher(line); - if (mtrcommentequation.find()) { - inequation = true; - templine.append(" @retval " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n"); - } else if (inequation && line.trim().length() == 0) { - inequation = false; - templine.append(line + "\n"); - } else if (inequation && line.trim().length() != 0) { - templine.append("#%#%" + line + "\n"); - } else { - templine.append(" " + line.trim() + "\n"); + } else if (incomment) { + if (line.contains("Routine Description:")) { + description = true; + arguments = false; + returns = false; + } else if (line.contains("Arguments:")) { + description = false; + arguments = true; + returns = false; + } else if (line.contains("Returns:")) { + description = false; + arguments = false; + returns = true; + } else if (description) { + if (line.trim().length() != 0) { + templine.append(" " + line.trim() + "\n"); + } + } else if (arguments) { + mtrcommentequation = ptncommentequation.matcher(line); + if (mtrcommentequation.find()) { + inequation = true; + templine.append(" @param " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n"); + } else if (inequation && line.trim().length() == 0) { + inequation = false; + templine.append(line + "\n"); + } else if (inequation && line.trim().length() != 0) { + templine.append("#%#%" + line + "\n"); + } else { + templine.append(" " + line.trim() + "\n"); + } + } else if (returns) { + mtrcommentequation = ptncommentequation.matcher(line); + if (mtrcommentequation.find()) { + inequation = true; + templine.append(" @retval " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n"); + } else if (inequation && line.trim().length() == 0) { + inequation = false; + templine.append(line + "\n"); + } else if (inequation && line.trim().length() != 0) { + templine.append("#%#%" + line + "\n"); + } else { + templine.append(" " + line.trim() + "\n"); + } } } else { templine.append(line + "\n");