Diff for /parser3/src/main/compile.y between versions 1.204.2.8.2.14 and 1.225

version 1.204.2.8.2.14, 2003/04/03 15:34:02 version 1.225, 2008/06/17 15:51:25
Line 2 Line 2
 /** @file  /** @file
         Parser: compiler(lexical parser and grammar).          Parser: compiler(lexical parser and grammar).
   
         Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com)          Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
         Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)          Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
   
         $Id$          $Id$
Line 41 Line 41
 // defines  // defines
   
 #define USE_CONTROL_METHOD_NAME "USE"  #define USE_CONTROL_METHOD_NAME "USE"
 #define TAB_SIZE 8  #define OPTIONS_CONTROL_METHOD_NAME "OPTION"
   
 // forwards  // forwards
   
Line 49  static int real_yyerror(Parse_control* p Line 49  static int real_yyerror(Parse_control* p
 static void yyprint(FILE* file, int type, YYSTYPE value);  static void yyprint(FILE* file, int type, YYSTYPE value);
 static int yylex(YYSTYPE* lvalp, void* pc);  static int yylex(YYSTYPE* lvalp, void* pc);
   
   static const VBool vfalse(false);
   static const VBool vtrue(true);
   static const VVoid vvoid;
   
 // local convinient inplace typecast & var  // local convinient inplace typecast & var
 #undef PC  #undef PC
Line 68  static int yylex(YYSTYPE* lvalp, void* p Line 71  static int yylex(YYSTYPE* lvalp, void* p
 %token BAD_HEX_LITERAL  %token BAD_HEX_LITERAL
 %token BAD_METHOD_DECL_START  %token BAD_METHOD_DECL_START
 %token BAD_METHOD_PARAMETER_NAME_CHARACTER  %token BAD_METHOD_PARAMETER_NAME_CHARACTER
 %token BAD_MATH_OPERATOR_CHARACTER  %token BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE
   
 %token LAND "&&"  %token LAND "&&"
 %token LOR "||"  %token LOR "||"
Line 95  static int yylex(YYSTYPE* lvalp, void* p Line 98  static int yylex(YYSTYPE* lvalp, void* p
 %token DEXISTS "-d"  %token DEXISTS "-d"
 %token IS "is"  %token IS "is"
   
   %token LITERAL_TRUE "true"
   %token LITERAL_FALSE "false"
   
 /* logical */  /* logical */
 %left "!||"  %left "!||"
 %left "||"  %left "||"
Line 145  control_method: '@' STRING '\n' Line 151  control_method: '@' STRING '\n'
                 YYERROR;                  YYERROR;
         }          }
         if(command==CLASS_NAME) {          if(command==CLASS_NAME) {
                   /*
                 if(PC.cclass->base_class()) { // already changed from default?                  if(PC.cclass->base_class()) { // already changed from default?
                         strcpy(PC.error, "class already have a name '");                          strcpy(PC.error, "class already have a name '");
                         strncat(PC.error, PC.cclass->name().cstr(), 100);                          strncat(PC.error, PC.cclass->name().cstr(), 100);
                         strcat(PC.error, "'");                          strcat(PC.error, "'");
                         YYERROR;                          YYERROR;
                 }                  }
                   */
                 if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) {                  if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) {
                         // new class' name                          // new class' name
                         const String& name=*LA2S(*strings_code);                          const String& name=*LA2S(*strings_code);
Line 160  control_method: '@' STRING '\n' Line 168  control_method: '@' STRING '\n'
                         PC.cclass->set_name(name);                          PC.cclass->set_name(name);
                         // append to request's classes                          // append to request's classes
                         PC.request.classes().put(name, cclass);                          PC.request.classes().put(name, cclass);
                           *PC.cclasses+=cclass;
                 } else {                  } else {
                         strcpy(PC.error, "@"CLASS_NAME" must contain sole name");                          strcpy(PC.error, "@"CLASS_NAME" must contain only one line with class name (contains more then one)");
                         YYERROR;                          YYERROR;
                 }                  }
         } else if(command==USE_CONTROL_METHOD_NAME) {          } else if(command==USE_CONTROL_METHOD_NAME) {
Line 198  control_method: '@' STRING '\n' Line 207  control_method: '@' STRING '\n'
                         strcpy(PC.error, "@"BASE_NAME" must contain sole name");                          strcpy(PC.error, "@"BASE_NAME" must contain sole name");
                         YYERROR;                          YYERROR;
                 }                  }
           } else if(command==OPTIONS_CONTROL_METHOD_NAME) {
                   for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE) {
                           const String& option=*LA2S(*strings_code, i);
                           if(option==ALL_VARS_LOCAL_NAME){
                                   PC.cclass->all_vars_local();
                           } else {
                                   strcpy(PC.error, option.cstr());
                                   strcat(PC.error, ": unknown option in @"OPTIONS_CONTROL_METHOD_NAME" was specified.");
                                   YYERROR;
                           }
                   }
         } else {          } else {
                 strcpy(PC.error, "'");                  strcpy(PC.error, "'");
                 strncat(PC.error, command.cstr(), MAX_STRING/2);                  strncat(PC.error, command.cstr(), MAX_STRING/2);
                 strcat(PC.error, "' invalid special name. valid names are "                  strcat(PC.error, "' invalid special name. valid names are "
                         "'"CLASS_NAME"', '"USE_CONTROL_METHOD_NAME"' and '"BASE_NAME"'");                          "'"CLASS_NAME"', '"USE_CONTROL_METHOD_NAME"', '"BASE_NAME"' and '"OPTIONS_CONTROL_METHOD_NAME"'.");
                 YYERROR;                  YYERROR;
         }          }
 };  };
Line 211  control_strings: control_string | contro Line 231  control_strings: control_string | contro
 control_string: maybe_string '\n';  control_string: maybe_string '\n';
 maybe_string: empty | STRING;  maybe_string: empty | STRING;
   
 code_method: '@' STRING bracketed_maybe_strings maybe_bracketed_strings maybe_comment '\n'   code_method: '@' STRING bracketed_maybe_strings maybe_bracketed_strings maybe_comment '\n' { 
                         maybe_codes {          PC.explicit_result=false;
         const String& name=*LA2S(*$2);  
   
         YYSTYPE params_names_code=$3;          YYSTYPE params_names_code=$3;
         ArrayString* params_names=0;          ArrayString* params_names=0;
Line 225  code_method: '@' STRING bracketed_maybe_ Line 244  code_method: '@' STRING bracketed_maybe_
   
         YYSTYPE locals_names_code=$4;          YYSTYPE locals_names_code=$4;
         ArrayString* locals_names=0;          ArrayString* locals_names=0;
           bool all_vars_local=false;
         if(int size=locals_names_code->count()) {          if(int size=locals_names_code->count()) {
                 locals_names=new ArrayString;                  locals_names=new ArrayString;
                 for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE)                  for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE) {
                         *locals_names+=LA2S(*locals_names_code, i);                          const String* local_name=LA2S(*locals_names_code, i);
                           if(*local_name==RESULT_VAR_NAME)
                                   PC.explicit_result=true;
                           else if(*local_name==ALL_VARS_LOCAL_NAME)
                                   all_vars_local=true;
                           else
                                   *locals_names+=local_name;
                   }
           }
           if(!all_vars_local && PC.cclass && PC.cclass->is_vars_local()){
                   all_vars_local=true;
         }          }
   
         Method& method=*new Method(          Method* method=new Method(
                 //name,                   //name, 
                 Method::CT_ANY,                  Method::CT_ANY,
                 0, 0/*min,max numbered_params_count*/,                   0, 0/*min,max numbered_params_count*/, 
                 params_names, locals_names,                   params_names, locals_names, 
                 $7, 0);                  0/*to be filled later in next {} */, 0, all_vars_local);
         PC.cclass->add_method(PC.alias_method(name), method);  
           *reinterpret_cast<Method**>(&$$)=method;
   
           // todo: check [][;result;]
   } maybe_codes {
           Method& method=*reinterpret_cast<Method*>($7);
           // fill in the code
           method.parser_code=$8;
           // register in class
           const String& name=*LA2S(*$2);
           PC.cclass->add_method(PC.alias_method(name), method);
 };  };
   
 maybe_bracketed_strings: empty | bracketed_maybe_strings;  maybe_bracketed_strings: empty | bracketed_maybe_strings;
Line 334  construct: Line 374  construct:
 |       construct_round  |       construct_round
 |       construct_curly  |       construct_curly
 ;  ;
 construct_square: '[' any_constructor_code_value ']' {  construct_square: '[' {
           // allow $result_or_other_variable[ letters here any time ]
           *reinterpret_cast<bool*>(&$$)=PC.explicit_result; PC.explicit_result=false;
   } any_constructor_code_value {
           PC.explicit_result=*reinterpret_cast<bool*>(&$2);
   } ']' {
         // stack: context, name          // stack: context, name
         $$=$2; // stack: context, name, value          $$=$3; // stack: context, name, value
         O(*$$, OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */          O(*$$, OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */
 }  }
 ;  ;
Line 388  call_value: '^' { Line 433  call_value: '^' {
         YYSTYPE params_code=$5;          YYSTYPE params_code=$5;
         if(params_code->count()==4) { // probably [] case. [OP_VALUE+origin+Void+STORE_PARAM]          if(params_code->count()==4) { // probably [] case. [OP_VALUE+origin+Void+STORE_PARAM]
                 if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value?                  if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value?
                         if(!value->is_defined()) // value is VVoid?                          if(value->is_void()) // value is VVoid?
                                 params_code=0; // ^zzz[] case. don't append lone empty param.                                  params_code=0; // ^zzz[] case. don't append lone empty param.
         }          }
         /* stack: context, method_junction */          /* stack: context, method_junction */
Line 403  store_param: Line 448  store_param:
 |       store_round_param  |       store_round_param
 |       store_curly_param  |       store_curly_param
 ;  ;
 store_square_param: '[' store_code_param_parts ']' {$$=$2};  store_square_param: '[' {
           // allow ^call[ letters here any time ]
           *reinterpret_cast<bool*>(&$$)=PC.explicit_result; PC.explicit_result=false;
   } store_code_param_parts {
           PC.explicit_result=*reinterpret_cast<bool*>(&$2);
   } ']' {$$=$3};
 store_round_param: '(' store_expr_param_parts ')' {$$=$2};  store_round_param: '(' store_expr_param_parts ')' {$$=$2};
 store_curly_param: '{' store_curly_param_parts '}' {$$=$2};  store_curly_param: '{' store_curly_param_parts '}' {$$=$2};
 store_code_param_parts:  store_code_param_parts:
Line 422  store_code_param_part: code_param_value Line 472  store_code_param_part: code_param_value
         $$=$1;          $$=$1;
         O(*$$, OP_STORE_PARAM);          O(*$$, OP_STORE_PARAM);
 };  };
 store_expr_param_part: write_expr_value {  store_expr_param_part: expr_value {
         $$=N();           YYSTYPE expr_code=$1;
         OA(*$$, OP_EXPR_CODE__STORE_PARAM, $1);          if(expr_code->count()==3
                   && (*expr_code)[0].code==OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP_VALUE+origin+Double]
                   $$=expr_code; 
                   O(*$$, OP_STORE_PARAM); // no evaluating
           } else {
                   ArrayOperation* code=N();
                   O(*code, OP_PREPARE_TO_EXPRESSION);
                   P(*code, *expr_code);
                   O(*code, OP_WRITE_EXPR_RESULT);
                   $$=N(); 
                   OA(*$$, OP_EXPR_CODE__STORE_PARAM, code);
           }
 };  };
 store_curly_param_part: maybe_codes {  store_curly_param_part: maybe_codes {
         $$=N();           $$=N(); 
Line 435  code_param_value: Line 496  code_param_value:
 |       STRING /* optimized [STRING] case */  |       STRING /* optimized [STRING] case */
 |       constructor_code_value /* [something complex] */  |       constructor_code_value /* [something complex] */
 ;  ;
 write_expr_value: expr_value {  
         $$=N();   
         O(*$$, OP_PREPARE_TO_EXPRESSION);  
         P(*$$, *$1);  
         O(*$$, OP_WRITE_EXPR_RESULT);  
 };  
   
 /* name */  /* name */
   
Line 482  name_expr_with_subvar_value: STRING subv Line 537  name_expr_with_subvar_value: STRING subv
         $$=N();           $$=N(); 
         OA(*$$, OP_STRING_POOL, code);          OA(*$$, OP_STRING_POOL, code);
 };  };
 name_square_code_value: '[' codes ']' {  name_square_code_value: '[' {
           // allow $result_or_other_variable[ letters here any time ]
           *reinterpret_cast<bool*>(&$$)=PC.explicit_result; PC.explicit_result=false;
   } codes {
           PC.explicit_result=*reinterpret_cast<bool*>(&$2);
   } ']' {
         $$=N();           $$=N(); 
         OA(*$$, OP_OBJECT_POOL, $2); /* stack: empty write context */          OA(*$$, OP_OBJECT_POOL, $3); /* stack: empty write context */
         /* some code that writes to that context */          /* some code that writes to that context */
         /* context=pop; stack: context.value() */          /* context=pop; stack: context.value() */
 };  };
Line 527  class_constructor_prefix: class_static_p Line 587  class_constructor_prefix: class_static_p
   
 /* expr */  /* expr */
   
 expr_value: expr {  expr_value: expr;
         // see OP_PREPARE_TO_EXPRESSION!!  
         if(($$=$1)->count()==2) // only one string literal in there?  
                 change_string_literal_to_double_literal(*$$); // make that string literal Double  
 };  
 expr:   expr: 
         STRING          double_or_STRING
   |   true_value
   |   false_value
 |       get_value  |       get_value
 |       call_value  |       call_value
 |       '"' string_inside_quotes_value '"' { $$ = $2; }  |       '"' string_inside_quotes_value '"' { $$ = $2 }
 |       '\'' string_inside_quotes_value '\'' { $$ = $2; }  |       '\'' string_inside_quotes_value '\'' { $$ = $2 }
 |       '(' expr ')' { $$ = $2; }  |       '(' expr ')' { $$ = $2; }
 /* stack: operand // stack: @operand */  /* stack: operand // stack: @operand */
 |       '-' expr %prec NUNARY { $$=$2;  O(*$$, OP_NEG) }  |       '-' expr %prec NUNARY { $$=$2;  O(*$$, OP_NEG) }
Line 578  expr: Line 636  expr:
 |       expr "is" expr { $$=$1;  P(*$$, *$3);  O(*$$, OP_IS) }  |       expr "is" expr { $$=$1;  P(*$$, *$3);  O(*$$, OP_IS) }
 ;  ;
   
   double_or_STRING: STRING {
           // optimized from OP_STRING->OP_VALUE for doubles
           maybe_change_string_literal_to_double_literal(*($$=$1));
   };
   
 string_inside_quotes_value: maybe_codes {  string_inside_quotes_value: maybe_codes {
         $$=N();          $$=N();
         OA(*$$, OP_STRING_POOL, $1); /* stack: empty write context */          OA(*$$, OP_STRING_POOL, $1); /* stack: empty write context */
Line 592  write_string: STRING { Line 655  write_string: STRING {
         change_string_literal_to_write_string_literal(*($$=$1))          change_string_literal_to_write_string_literal(*($$=$1))
 };  };
   
 void_value: /* empty */ { $$=VL(new VVoid(), 0, 0, 0) };  void_value: /* empty */ { $$=VL(/*we know that we will not change it*/const_cast<VVoid*>(&vvoid), 0, 0, 0) }
   true_value: "true" { $$ = VL(/*we know that we will not change it*/const_cast<VBool*>(&vtrue), 0, 0, 0) }
   false_value: "false" { $$ = VL(/*we know that we will not change it*/const_cast<VBool*>(&vfalse), 0, 0, 0) }
   
 empty: /* empty */ { $$=N() };  empty: /* empty */ { $$=N() };
   
 %%  %%
Line 645  static int yylex(YYSTYPE *lvalp, void *a Line 711  static int yylex(YYSTYPE *lvalp, void *a
                 c=*(end=(pc.source++));                  c=*(end=(pc.source++));
 //              fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp);  //              fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp);
   
                 if(c=='\n') {                  if(c=='\n')
                         pc.pos_next_line();                          pc.pos_next_line();
                 } else                  else
                         pc.pos.col+=c=='\t'?TAB_SIZE:1;                          pc.pos_next_c(c);
   //              fprintf(stderr, "\nchar: %c file(%d:%d)", c, pc.pos.line, pc.pos.col);
   
                 if(c=='@' && pc.pos.col==0+1) {                  if(pc.pos.col==0+1 && c=='@') {
                         if(pc.ls==LS_DEF_SPECIAL_BODY) {                          if(pc.ls==LS_DEF_SPECIAL_BODY) {
                                 // @SPECIAL                                  // @SPECIAL
                                 // ...                                  // ...
Line 663  static int yylex(YYSTYPE *lvalp, void *a Line 730  static int yylex(YYSTYPE *lvalp, void *a
                         } else // @ in first column inside some code [when could that be?]                          } else // @ in first column inside some code [when could that be?]
                                 result=BAD_METHOD_DECL_START;                                  result=BAD_METHOD_DECL_START;
                         goto break2;                          goto break2;
                 } else if(c=='^') {                  }
                   if(c=='^') {
                         if(pc.ls==LS_METHOD_AFTER) {                          if(pc.ls==LS_METHOD_AFTER) {
                                 // handle after-method situation                                  // handle after-method situation
                                 pop_LS(pc);                                  pop_LS(pc);
Line 694  default: Line 762  default:
                                         if(!pc.string_start)                                          if(!pc.string_start)
                                                 pc.string_start=begin_pos;                                                  pc.string_start=begin_pos;
                                         // append piece till ^                                          // append piece till ^
                                         pc.string.append_strdup(begin, end-begin);                                          pc.string.append_strdup_know_length(begin, end-begin);
                                 }                                  }
                                 // reset piece 'begin' position & line                                  // reset piece 'begin' position & line
                                 begin=pc.source; // ->punctuation                                  begin=pc.source; // ->punctuation
Line 710  default: Line 778  default:
                                         if(!pc.string_start)                                          if(!pc.string_start)
                                                 pc.string_start=begin_pos;                                                  pc.string_start=begin_pos;
                                         // append piece till ^                                          // append piece till ^
                                         pc.string.append_strdup(begin, end-begin);                                          pc.string.append_strdup_know_length(begin, end-begin);
                                 }                                  }
                                 // #HH ?                                  // #HH ?
                                 if(pc.source[0]=='#' && pc.source[1] && pc.source[2]) {                                  if(pc.source[0]=='#' && pc.source[1] && pc.source[2]) {
                                         char c=                                          char c=(char)(
                                                 hex_value[(unsigned char)pc.source[1]]*0x10+                                                  hex_value[(unsigned char)pc.source[1]]*0x10+
                                                 hex_value[(unsigned char)pc.source[2]];                                                  hex_value[(unsigned char)pc.source[2]]);
                                         if(c==0) {                                          if(c==0) {
                                                 result=BAD_HEX_LITERAL;                                                  result=BAD_HEX_LITERAL;
                                                 goto break2; // wrong hex value[no ^#00 chars allowed]: bail out                                                  goto break2; // wrong hex value[no ^#00 chars allowed]: bail out
Line 743  default: Line 811  default:
                                 if(!pc.string_start)                                  if(!pc.string_start)
                                         pc.string_start=begin_pos;                                          pc.string_start=begin_pos;
                                 // append piece till #                                  // append piece till #
                                 pc.string.append_strdup(begin, end-begin);                                  pc.string.append_strdup_know_length(begin, end-begin);
                         }                          }
                         // fall into COMMENT lexical state [wait for \n]                          // fall into COMMENT lexical state [wait for \n]
                         push_LS(pc, LS_USER_COMMENT);                          push_LS(pc, LS_USER_COMMENT);
Line 782  default: Line 850  default:
                                         lexical_brackets_nestage++;                                          lexical_brackets_nestage++;
                                 break;                                  break;
                         }                          }
                           if(pc.explicit_result && c)
                                   switch(c) {
                                   case '\n': case ' ': case '\t':
                                           begin=pc.source;
                                           begin_pos=pc.pos;
                                           continue; // skip it
                                   default:
                                           result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE;
                                           goto break2;
                                   }
                         break;                          break;
                                                   
                 // #COMMENT                  // #COMMENT
Line 888  default: Line 966  default:
                                         if(!pc.string_start)                                          if(!pc.string_start)
                                                 pc.string_start=begin_pos;                                                  pc.string_start=begin_pos;
                                         // append piece till #                                          // append piece till #
                                         pc.string.append_strdup(begin, end-begin);                                          pc.string.append_strdup_know_length(begin, end-begin);
                                 }                                  }
                                 // fall into COMMENT lexical state [wait for \n]                                  // fall into COMMENT lexical state [wait for \n]
                                 push_LS(pc, LS_EXPRESSION_COMMENT);                                  push_LS(pc, LS_EXPRESSION_COMMENT);
Line 1019  default: Line 1097  default:
                         case 'd':                          case 'd':
                                 if(end==begin) // right after whitespace                                  if(end==begin) // right after whitespace
                                         if(pc.source[0]=='e' && pc.source[1]=='f') { // def                                          if(pc.source[0]=='e' && pc.source[1]=='f') { // def
                                                 skip_analized=2;                                                  switch(pc.source[2]){
                                                 result=DEF;                                                  case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed
                                                           skip_analized=2;
                                                           result=DEF;
                                                           goto break2;
                                                   }
                                                   // error: incorrect char after 'def'
                                           }
                                   break;
                           case 't':
                                   if(end==begin) // right after whitespace
                                           if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true
                                                   skip_analized=3;
                                                   result=LITERAL_TRUE;
                                                   goto break2;
                                           }
                                   break;
                           case 'f':
                                   if(end==begin) // right after whitespace
                                           if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false
                                                   skip_analized=4;
                                                   result=LITERAL_FALSE;
                                                 goto break2;                                                  goto break2;
                                         }                                          }
                                 break;                                  break;
Line 1100  default: Line 1198  default:
                         case '=': case '!':                          case '=': case '!':
                         // common delimiters                          // common delimiters
                         case ',': case '?': case '#':                          case ',': case '?': case '#':
                           // mysql column separators
                           case '`':
                         // before call                          // before call
                         case '^':                           case '^': 
                                 pop_LS(pc);                                  pop_LS(pc);
Line 1235  default: Line 1335  default:
                         case ':': // ':name' or 'class:name'                          case ':': // ':name' or 'class:name'
                         case '^': // ^abc^xxx wrong. bailing out                          case '^': // ^abc^xxx wrong. bailing out
                         case ']': case '}': case ')': // ^abc]}) wrong. bailing out                          case ']': case '}': case ')': // ^abc]}) wrong. bailing out
                           case ' ': // ^if ( wrong. bailing out
                                 RC;                                  RC;
                         }                          }
                         break;                          break;
Line 1281  default: Line 1382  default:
                                 lexical_brackets_nestage++;                                  lexical_brackets_nestage++;
                                 break;                                  break;
                         }                          }
                           if(pc.explicit_result && c)
                                   switch(c) {
                                   case '\n': case ' ': case '\t':
                                           begin=pc.source;
                                           begin_pos=pc.pos;
                                           continue; // skip it
                                   default:
                                           result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE;
                                           goto break2;
                                   }
                         break;                          break;
   
                 case LS_METHOD_AFTER:                  case LS_METHOD_AFTER:
Line 1322  break2: Line 1433  break2:
                         if(!pc.string_start)                          if(!pc.string_start)
                                 pc.string_start=begin_pos;                                  pc.string_start=begin_pos;
                         // append it                          // append it
                         pc.string.append_strdup(begin, end-begin);                          pc.string.append_strdup_know_length(begin, end-begin);
                 }                  }
         }          }
         if(!pc.string.is_empty()) { // something accumulated?          if(!pc.string.is_empty()) { // something accumulated?

Removed from v.1.204.2.8.2.14  
changed lines
  Added in v.1.225


E-mail: