skipBlockComment returns the index of the closing "/" of the /* */ comment opened at i, or len(s)-1 if unterminated.
(s string, i int)
| 843 | // skipBlockComment returns the index of the closing "/" of the /* */ comment |
| 844 | // opened at i, or len(s)-1 if unterminated. |
| 845 | func skipBlockComment(s string, i int) int { |
| 846 | for j := i + 2; j+1 < len(s); j++ { |
| 847 | if s[j] == '*' && s[j+1] == '/' { |
| 848 | return j + 1 |
| 849 | } |
| 850 | } |
| 851 | return len(s) - 1 |
| 852 | } |
| 853 | |
| 854 | // skipLineComment returns the index of the newline ending the -- or # comment |
| 855 | // opened at i, or len(s)-1 if it runs to the end. |