#line 4185 "/home/travis/build/felix-lang/felix/src/packages/flx_web.fdoc"
  include "./scanner-interface";
  
  fun setup(config_data:string) = {
    eprintln$ "Setup fdoc_scanner " + config_data;
    return 0;
  }
  
  
  object fdoc_scanner () implements fdocscanner-control_t = {
    method fun whatami () => "Scanner object";
  
    method gen fdoc_scan (var inp:string) () : opt[fdoc-data_t] = {
      var lines = split (inp,"\n");
      var out = "";
      String::reserve (&out,inp.len);
      for line in lines do
        if line.[0]=='@' and line.[1] != "{" do
          if out !=""  do
             yield Some (Text out);
             out = "";
          done
          yield Some (Cmd$ strip(line.[1 to]));
        else
          out+=line;
          out+="\n";
        done
      done;
      if out != "" do
        yield Some (Text out);
      done
      return None[fdoc-data_t];
    }
  
    // split up doc text into a stream of paragraphs
    method gen psplit (var inp:string) () : opt[string] = {
      var lines = split(inp,"\n");
      var out = "";
      String::reserve (&out,inp.len);
      for line in lines do
        // accumulate non-blank lines
        if line != "" do
          out += line;
          out += "\n";
  
        else // emit accumulated lines
          if out != "" do
            yield Some out;
            out = "";
          done
        done
      done
      if out != "" do
        yield Some out;
        out = ""; // no semantics but release memory
      done
      return None[string];
    }
  }
  
  
  export fun setup of (string) as "fdoc_scanner_setup";
  export fun fdoc_scanner of () as "fdoc_scanner";