changeset 22:1bd3a6740cfb

Fix return value calculation.
author Mikhail Kryshen <mikhail@kryshen.net>
date Wed, 22 Apr 2009 03:04:30 +0400
parents 8c6302226917
children 55fe63bb7858
files doc/manual/manual.tema src/kryshen/tema/TemplateParser.java
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/doc/manual/manual.tema	Wed Apr 22 01:48:11 2009 +0400
     1.2 +++ b/doc/manual/manual.tema	Wed Apr 22 03:04:30 2009 +0400
     1.3 @@ -58,8 +58,8 @@
     1.4  <%par:Every function returns integer value. The general convention is to 
     1.5  return non-zero for successful operation. The value of the macro substitution 
     1.6  is the return value of the first function in the function list. The value of
     1.7 -any Tema text is the sum value of all macro in the text, except the value of
     1.8 -the text without any macro equals -1.%>
     1.9 +any Tema text is the sum of the absolute values of all macro in the text,
    1.10 +except the value of the text without any macro equals -1.%>
    1.11  
    1.12  <%par:Internally, Tema function could be represented by any Java object.
    1.13  Instances of kryshen.tema.Function and kryshen.tema.Context are handled
     2.1 --- a/src/kryshen/tema/TemplateParser.java	Wed Apr 22 01:48:11 2009 +0400
     2.2 +++ b/src/kryshen/tema/TemplateParser.java	Wed Apr 22 03:04:30 2009 +0400
     2.3 @@ -184,9 +184,9 @@
     2.4                      
     2.5                      int tb = termBracket;
     2.6                      termBracket = openBracket;
     2.7 -                    int returnCode = Math.abs(parseFunction(in, out, format));
     2.8 +                    int returnCode = parseFunction(in, out, format);
     2.9                      lastReturnCode = returnCode;
    2.10 -                    result.retCode += returnCode;
    2.11 +                    result.retCode += Math.abs(returnCode);
    2.12                      result.empty = false;
    2.13                      termBracket = tb;
    2.14