Branch: Tag:

2001-09-27

2001-09-27 19:53:28 by Martin Nilsson <mani@lysator.liu.se>

Only handle // comments, since /* */ detection code is buggy.

Rev: bin/extract.pike:1.11

2:   // Copyright © 2000, Roxen IS.   // By Martin Nilsson and Andreas Lange   // - // $Id: extract.pike,v 1.10 2001/02/20 06:21:31 nilsson Exp $ + // $Id: extract.pike,v 1.11 2001/09/27 19:53:28 nilsson Exp $   //      
535:    // The order between // blocks and /* */ blocks is not important    // for our purposes.    string comments = ""; -  foreach(in/"//", string line) { +  foreach( (in/"//")[1..], string line) {    sscanf(line, "%s\n", line);    comments += line+"\n";    } -  foreach(in/"/\052", string block) { -  string c = ""; -  sscanf(block, "%s\052/", c); -  comments += c+"\n"; -  } +     -  +  // This is code is flawed. Breaks in e.g. userfs.pike in Roxen. +  // foreach(in/"/\052", string block) { +  // string c = ""; +  // sscanf(block, "%s\052/", c); +  // comments += c+"\n"; +  // } +     array(string) tokens = ({});    Parser.HTML()->    add_container("locale-token",
552:    if(args->project && m->project!=args->project)    return 0;    c = String.trim_whites(c); -  if(has_value(tokens, c)) -  werror("\n* Warning: Token %O already found\n", c); +  if(has_value(tokens, c)) { +  werror("\n* Warning: Token %O already found.\n", c); +  }    tokens += ({c});    if (m->project)    args->project = m->project;
1038:       if( (!(xml_name && args->sync && args->xmlpath && args->baselang)) &&    (!sizeof(files) || args->help) ) { -  sscanf("$Revision: 1.10 $", "$"+"Revision: %s $", string v); +  sscanf("$Revision: 1.11 $", "$"+"Revision: %s $", string v);    werror("\n Locale Extractor Utility "+v+"\n\n");    werror(" Syntax: extract.pike [arguments] infile(s)\n\n");    werror(" Arguments: --project=name default: first found in infile\n");