MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / skip_white

Function skip_white

src/gpre/gpre.cpp:2757–2914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2755//
2756
2757static SSHORT skip_white()
2758{
2759 SSHORT c;
2760
2761 while (true)
2762 {
2763 if ((c = nextchar()) == EOF)
2764 return c;
2765
2766 c = c & 0xff;
2767
2768 // skip Fortran comments
2769
2770#ifdef GPRE_FORTRAN
2771 if (gpreGlob.sw_language == lang_fortran &&
2772 line_position == 1 && (c == 'C' || c == 'c' || c == '*'))
2773 {
2774 while ((c = nextchar()) != '\n' && c != EOF)
2775 ;
2776 continue;
2777 }
2778#endif
2779
2780#ifdef GPRE_COBOL
2781 // skip sequence numbers when ansi COBOL
2782
2783 if (gpreGlob.sw_language == lang_cobol && isAnsiCobol(gpreGlob.sw_cob_dialect))
2784 {
2785 while (line_position < 7 && (c = nextchar()) != '\n' && c != EOF)
2786 ;
2787 }
2788
2789 // skip COBOL comments and conditional compilation
2790
2791 if (gpreGlob.sw_language == lang_cobol &&
2792 (!isAnsiCobol(gpreGlob.sw_cob_dialect) && line_position == 1 &&
2793 (c == 'C' || c == 'c' || c == '*' || c == '/' || c == '\\') ||
2794 (isAnsiCobol(gpreGlob.sw_cob_dialect) && line_position == 7 && c != '\t' &&
2795 c != ' ' && c != '-')))
2796 {
2797 while ((c = nextchar()) != '\n' && c != EOF)
2798 ;
2799 continue;
2800 }
2801#endif
2802
2803 const UCHAR char_class = get_classes(c);
2804
2805 if (char_class & CHR_WHITE) {
2806 continue;
2807 }
2808
2809 // skip in-line SQL comments
2810
2811 if (gpreGlob.sw_sql && (c == '-'))
2812 {
2813 const SSHORT c2 = nextchar();
2814 if (c2 != '-')

Callers 1

get_tokenFunction · 0.85

Calls 5

nextcharFunction · 0.85
isAnsiCobolFunction · 0.85
get_classesFunction · 0.85
return_charFunction · 0.85
isLangCppFunction · 0.85

Tested by

no test coverage detected