Changeset f92cf8 in git
- Timestamp:
- Jul 21, 1999, 9:52:53 PM (25 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 65a2bd9f87363fac232bdb2f6e2bcc91faad71fe
- Parents:
- 18bd9c70860cace4782c5c85c88c5ad93550527f
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/libparse.l
r18bd9c rf92cf8 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: libparse.l,v 1.3 4 1999-07-21 11:41:16obachman Exp $ */5 /* $Id: libparse.l,v 1.35 1999-07-21 19:52:52 obachman Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 126 126 # endif /* STANDALONE_PARSER */ 127 127 128 static unsigned long help_chksum; 128 129 # define SET_DEF_END(mode, pi, p) \ 129 130 if ( mode == LOAD_LIB) pi->data.s.def_end = p; 130 131 # define SET_HELP_START(mode, pi, p) \ 131 if ( mode == LOAD_LIB) pi->data.s.help_start = p; 132 132 if ( mode == LOAD_LIB) {pi->data.s.help_start = p; help_chksum = 0;} 133 133 # define SET_HELP_END(mode, pi, p) \ 134 if ( mode == LOAD_LIB) pi->data.s.help_end = p; 134 if ( mode == LOAD_LIB) {pi->data.s.help_end = p; \ 135 pi->data.s.help_chksum = help_chksum;} 135 136 136 137 # define SET_BODY_START(mode, pi, l, p) \ … … 155 156 if(pi->data.s.body_end==0) pi->data.s.body_end = p-1; \ 156 157 } 158 159 #define ROTATE_RIGHT(c) if ((c) & 01) (c) = ((c) >>1) + 0x8000; else (c) >>= 1; 160 #define IncrCheckSum(c) \ 161 do \ 162 { \ 163 ROTATE_RIGHT(help_chksum); \ 164 help_chksum += c; \ 165 help_chksum &= 0xffff; \ 166 } \ 167 while(0) 157 168 158 169 # undef YY_DECL … … 606 617 #endif 607 618 } 608 <phelp>\n { yylplineno++; 619 <phelp>\n { yylplineno++;} 609 620 610 621 <pbody>({comment}[^\n]*) { } … … 695 706 last_cmd = LP_NONE; 696 707 if(old_state==phelp) 708 { 697 709 SET_HELP_END(mode, pi, current_pos(0)); 710 } 698 711 BEGIN(old_state); /* printf("%s", yytext); */ 699 712 } 700 <string>(\\\\)|(\\\") { }701 <string>\n { yylplineno++; }702 <string>. { }713 <string>(\\\\)|(\\\") { if (old_state == phelp) IncrCheckSum(*yytext);} 714 <string>\n { yylplineno++; if (old_state == phelp) IncrCheckSum('\n');} 715 <string>. { if (old_state == phelp) IncrCheckSum(*yytext);} 703 716 704 717 <pexample>(\/\/[^\n]*) { } -
Singular/utils.cc
r18bd9c rf92cf8 128 128 pi->data.s.example_lineno = 0; 129 129 pi->data.s.body = NULL; 130 pi->data.s.help_chksum = 0; 130 131 return(pi); 131 132 } … … 199 200 PrintOut(fp, pi->data.s.example_start, pi->data.s.proc_end); 200 201 printf("\nEOT\n"); 202 printf("$chksum{\"%s\"} = %d;\n", pi->procname, pi->data.s.help_chksum); 201 203 } 202 204 }
Note: See TracChangeset
for help on using the changeset viewer.