(ch rune)
| 14 | } |
| 15 | |
| 16 | func IsWhiteSpaceSingleLine(ch rune) bool { |
| 17 | // Note: nextLine is in the Zs space, and should be considered to be a whitespace. |
| 18 | // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript. |
| 19 | switch ch { |
| 20 | case |
| 21 | ' ', // space |
| 22 | '\t', // tab |
| 23 | '\v', // verticalTab |
| 24 | '\f', // formFeed |
| 25 | 0x0085, // nextLine |
| 26 | 0x00A0, // nonBreakingSpace |
| 27 | 0x1680, // ogham |
| 28 | 0x2000, // enQuad |
| 29 | 0x2001, // emQuad |
| 30 | 0x2002, // enSpace |
| 31 | 0x2003, // emSpace |
| 32 | 0x2004, // threePerEmSpace |
| 33 | 0x2005, // fourPerEmSpace |
| 34 | 0x2006, // sixPerEmSpace |
| 35 | 0x2007, // figureSpace |
| 36 | 0x2008, // punctuationEmSpace |
| 37 | 0x2009, // thinSpace |
| 38 | 0x200A, // hairSpace |
| 39 | 0x200B, // zeroWidthSpace |
| 40 | 0x202F, // narrowNoBreakSpace |
| 41 | 0x205F, // mathematicalSpace |
| 42 | 0x3000, // ideographicSpace |
| 43 | 0xFEFF: // byteOrderMark |
| 44 | return true |
| 45 | } |
| 46 | return false |
| 47 | } |
| 48 | |
| 49 | func IsLineBreak(ch rune) bool { |
| 50 | // ES5 7.3: |
no outgoing calls
no test coverage detected