diff options
author | Oscar Campbell <oscar@campbell.nu> | 2015-05-31 01:32:50 +0200 |
---|---|---|
committer | Oscar Campbell <oscar@campbell.nu> | 2015-05-31 01:32:50 +0200 |
commit | d35887e492613e646f4fcc04f8314cc897afe793 (patch) | |
tree | 7885f782b4e64e6916952a38a51686538690a456 /lib/pure | |
parent | 1b4db5a34caf301995b3c08eb9a1e3b75c54a9ba (diff) | |
download | Nim-d35887e492613e646f4fcc04f8314cc897afe793.tar.gz |
Util funcs used by lib/hashes.nim and compiler/lexer.nim
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/etcpriv.nim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/pure/etcpriv.nim b/lib/pure/etcpriv.nim new file mode 100644 index 000000000..e7a525e4d --- /dev/null +++ b/lib/pure/etcpriv.nim @@ -0,0 +1,23 @@ +# +# +# Nim's Runtime Library +# (c) Copyright 2015 Nim Authors +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## This module contains utils that are less then easy to categorize and +## don't really warrant a specific module. They are private to compiler +## and stdlib usage, and should not be used outside of that - they may +## change or disappear at any time. + + +# Used by pure/hashes.nim, and the compiler parsing +const magicIdentSeparatorRuneByteWidth* = 3 + +# Used by pure/hashes.nim, and the compiler parsing +proc isMagicIdentSeparatorRune*(cs: cstring, i: int): bool {. inline } = + result = cs[i] == '\226' and + cs[i + 1] == '\128' and + cs[i + 2] == '\147' # en-dash # 145 = nb-hyphen |