(ch rune)
| 47 | } |
| 48 | |
| 49 | func IsLineBreak(ch rune) bool { |
| 50 | // ES5 7.3: |
| 51 | // The ECMAScript line terminator characters are listed in Table 3. |
| 52 | // Table 3: Line Terminator Characters |
| 53 | // Code Unit Value Name Formal Name |
| 54 | // \u000A Line Feed <LF> |
| 55 | // \u000D Carriage Return <CR> |
| 56 | // \u2028 Line separator <LS> |
| 57 | // \u2029 Paragraph separator <PS> |
| 58 | // Only the characters in Table 3 are treated as line terminators. Other new line or line |
| 59 | // breaking characters are treated as white space but not as line terminators. |
| 60 | switch ch { |
| 61 | case |
| 62 | '\n', // lineFeed |
| 63 | '\r', // carriageReturn |
| 64 | 0x2028, // lineSeparator |
| 65 | 0x2029: // paragraphSeparator |
| 66 | return true |
| 67 | } |
| 68 | return false |
| 69 | } |
| 70 | |
| 71 | func IsDigit(ch rune) bool { |
| 72 | return ch >= '0' && ch <= '9' |
no outgoing calls
no test coverage detected