MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / quickscan

Function quickscan

modules/dasSQLITE/sqlite/shell.c:26316–26396  ·  view source on GitHub ↗

** Scan line for classification to guide shell's handling. ** The scan is resumable for subsequent lines when prior ** return values are passed as the 2nd argument. */

Source from the content-addressed store, hash-verified

26314** return values are passed as the 2nd argument.
26315*/
26316static QuickScanState quickscan(char *zLine, QuickScanState qss,
26317 SCAN_TRACKER_REFTYPE pst){
26318 char cin;
26319 char cWait = (char)qss; /* intentional narrowing loss */
26320 if( cWait==0 ){
26321 PlainScan:
26322 assert( cWait==0 );
26323 while( (cin = *zLine++)!=0 ){
26324 if( IsSpace(cin) )
26325 continue;
26326 switch (cin){
26327 case '-':
26328 if( *zLine!='-' )
26329 break;
26330 while((cin = *++zLine)!=0 )
26331 if( cin=='\n')
26332 goto PlainScan;
26333 return qss;
26334 case ';':
26335 qss |= QSS_EndingSemi;
26336 continue;
26337 case '/':
26338 if( *zLine=='*' ){
26339 ++zLine;
26340 cWait = '*';
26341 CONTINUE_PROMPT_AWAITS(pst, "/*");
26342 qss = QSS_SETV(qss, cWait);
26343 goto TermScan;
26344 }
26345 break;
26346 case '[':
26347 cin = ']';
26348 deliberate_fall_through;
26349 case '`': case '\'': case '"':
26350 cWait = cin;
26351 qss = QSS_HasDark | cWait;
26352 CONTINUE_PROMPT_AWAITC(pst, cin);
26353 goto TermScan;
26354 case '(':
26355 CONTINUE_PAREN_INCR(pst, 1);
26356 break;
26357 case ')':
26358 CONTINUE_PAREN_INCR(pst, -1);
26359 break;
26360 default:
26361 break;
26362 }
26363 qss = (qss & ~QSS_EndingSemi) | QSS_HasDark;
26364 }
26365 }else{
26366 TermScan:
26367 while( (cin = *zLine++)!=0 ){
26368 if( cin==cWait ){
26369 switch( cWait ){
26370 case '*':
26371 if( *zLine != '/' )
26372 continue;
26373 ++zLine;

Callers 2

process_inputFunction · 0.85

Calls 2

assertFunction · 0.85
IsSpaceFunction · 0.85

Tested by

no test coverage detected