Skip to content

Instantly share code, notes, and snippets.

@nchanged
Last active May 23, 2019 11:48
Show Gist options
  • Save nchanged/0017c5f31b6e713b2347d3d32207fb04 to your computer and use it in GitHub Desktop.
Save nchanged/0017c5f31b6e713b2347d3d32207fb04 to your computer and use it in GitHub Desktop.
token_groups.ts
const CharsTokenEnd = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0xa,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0x20,-1,-1,-1,-1,-1,-1,-1,0x28,0x29,-1,-1,0x2c,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0x3a,0x3b,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0x7b,-1,0x7d,-1]
const CharsTokenStart = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0x23,0x24,-1,-1,-1,-1,-1,-1,-1,-1,0x2d,0x2e,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0x3a,-1,-1,-1,-1,-1,-1,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,-1,-1,-1,-1,-1,-1,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,-1,-1,-1,-1]
switch(pos){
case CharsTokenEnd[pos]:
break;
case CharsTokenStart[pos]:
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment