/[CvsGraph]/cvsgraph/rcsy.y
ViewVC logotype

Diff of /cvsgraph/rcsy.y

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.10, Thu Oct 21 21:40:35 2004 UTC revision 1.12, Mon Jun 13 20:57:27 2005 UTC
# Line 48  Line 48 
48  static dtexts_t *add_dtexts(dtexts_t *s, dtext_t *t);  static dtexts_t *add_dtexts(dtexts_t *s, dtext_t *t);
49  static phrase_t *new_phrase(phrase_type_e pt, char *t);  static phrase_t *new_phrase(phrase_type_e pt, char *t);
50  static phrases_t *add_phrases(phrases_t *s, phrase_t *t);  static phrases_t *add_phrases(phrases_t *s, phrase_t *t);
51    static phrases_t *merge_phrases(phrases_t *s, phrases_t *t);
52  static delta_t *new_delta(char *rev, char *date, char *author, char *state, revs_t *branches, char *next, phrases_t *phrases);  static delta_t *new_delta(char *rev, char *date, char *author, char *state, revs_t *branches, char *next, phrases_t *phrases);
53  static deltas_t *add_deltas(deltas_t *s, delta_t *t);  static deltas_t *add_deltas(deltas_t *s, delta_t *t);
54  static rcsfile_t *new_rcsfile(char *head, char *branch, ids_t *access, tags_t *tags,  static rcsfile_t *new_rcsfile(char *head, char *branch, ids_t *access, tags_t *tags,
# Line 78  Line 79 
79  %token tDESC tLOG tTEXT  %token tDESC tLOG tTEXT
80  %token tOWNER tGROUP tPERMISSIONS tSPECIAL tSYMLINK tHARDLINKS  %token tOWNER tGROUP tPERMISSIONS tSPECIAL tSYMLINK tHARDLINKS
81  %token tNAMESPACE tDEAD tMERGEPOINT  %token tNAMESPACE tDEAD tMERGEPOINT
82  %token tDELTATYPE tCOMMITID tKOPT tFILENAME  %token tDELTATYPE tCOMMITID tKOPT tFILENAME tPROPERTIES
83  %token <str> tNEWPHRASE  %token <str> tNEWPHRASE
84  %token <str> tSTRING tREV tID tSYM  %token <str> tSTRING tREV tID tSYM
85    
# Line 174  Line 175 
175            tAUTHOR { set_author(); } idorstr ';'            tAUTHOR { set_author(); } idorstr ';'
176            tSTATE  { set_id(); } oid ';'            tSTATE  { set_id(); } oid ';'
177            tBRANCHES orevs ';'            tBRANCHES orevs ';'
178              ophrases
179            tNEXT orev ';'            tNEXT orev ';'
180            ophrases                      { $$ = new_delta($1, $3, $7, $11, $14, $17, $19); }            ophrases                      { $$ = new_delta($1, $3, $7, $11, $14, $18, merge_phrases($16, $20)); }
181          ;          ;
182    
183  idorstr : tID                           { $$ = $1; }  idorstr : tID                           { $$ = $1; }
# Line 206  Line 208 
208                  }                  }
209          | cvskw { set_skip(); } ';'     { $$ = NULL; /* yywarning("CVS extended keyword skipped"); */ }          | cvskw { set_skip(); } ';'     { $$ = NULL; /* yywarning("CVS extended keyword skipped"); */ }
210          | otherkw { set_skip(); } ';'   { $$ = NULL; /* yywarning("Other extended keyword"); */ }          | otherkw { set_skip(); } ';'   { $$ = NULL; /* yywarning("Other extended keyword"); */ }
211          | tMERGEPOINT tSTRING ';'       { $$ = new_phrase(PT_MERGEPOINT, $2); }          | tMERGEPOINT tSTRING ';'       { $$ = new_phrase(PT_MERGEPOINT, $2); }
212            | tMERGEPOINT tREV ';'          { $$ = new_phrase(PT_MERGEPOINT, $2); }
213          ;          ;
214    
215  cvskw   : tOWNER  cvskw   : tOWNER
# Line 223  Line 226 
226          | tCOMMITID          | tCOMMITID
227          | tKOPT          | tKOPT
228          | tFILENAME          | tFILENAME
229            | tPROPERTIES
230          ;          ;
231    
232  ostr    : /* Empty */                   { $$ = NULL; }  ostr    : /* Empty */                   { $$ = NULL; }
# Line 470  Line 474 
474          return s;          return s;
475  }  }
476    
477    static phrases_t *merge_phrases(phrases_t *s, phrases_t *t)
478    {
479            if(!t)
480                    return s;
481            if(!s)
482                    return t;
483            s->phrases = xrealloc(s->phrases, (s->nphrases + t->nphrases) * sizeof(s->phrases[0]));
484            memcpy(&s->phrases[s->nphrases], &t->phrases[0], t->nphrases * sizeof(t->phrases[0]));
485            s->nphrases += t->nphrases;
486            /* FIXME: Free t and content; hm, who cares... */
487            return s;
488    }
489    
490  static phrase_t *find_mergepoint(phrases_t *p)  static phrase_t *find_mergepoint(phrases_t *p)
491  {  {
492          int i;          int i;

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0