diff options
-rw-r--r-- | compiler/lexer.nim | 2 | ||||
-rw-r--r-- | lib/packages/docutils/highlite.nim | 2 | ||||
-rw-r--r-- | tests/lexer/thexlit.nim | 12 | ||||
-rw-r--r-- | tests/lexer/thexrange.nim | 8 | ||||
-rw-r--r-- | tests/lexer/tlexermisc.nim | 27 |
5 files changed, 29 insertions, 22 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 591561987..d498cf4af 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -25,7 +25,7 @@ const SymChars*: set[char] = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF'} SymStartChars*: set[char] = {'a'..'z', 'A'..'Z', '\x80'..'\xFF'} OpChars*: set[char] = {'+', '-', '*', '/', '\\', '<', '>', '!', '?', '^', '.', - '|', '=', '%', '&', '$', '@', '~', ':', '\x80'..'\xFF'} + '|', '=', '%', '&', '$', '@', '~', ':'} # don't forget to update the 'highlite' module if these charsets should change diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index 4f1264c9e..fbd2d7eca 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -130,7 +130,7 @@ proc nimNumber(g: var GeneralTokenizer, position: int): int = const OpChars = {'+', '-', '*', '/', '\\', '<', '>', '!', '?', '^', '.', - '|', '=', '%', '&', '$', '@', '~', ':', '\x80'..'\xFF'} + '|', '=', '%', '&', '$', '@', '~', ':'} proc nimNextToken(g: var GeneralTokenizer) = const diff --git a/tests/lexer/thexlit.nim b/tests/lexer/thexlit.nim deleted file mode 100644 index 2b7f0a40e..000000000 --- a/tests/lexer/thexlit.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "thexlit.nim" - output: "equal" -""" - -var t=0x950412DE - -if t==0x950412DE: - echo "equal" -else: - echo "not equal" - diff --git a/tests/lexer/thexrange.nim b/tests/lexer/thexrange.nim deleted file mode 100644 index 461e41dfd..000000000 --- a/tests/lexer/thexrange.nim +++ /dev/null @@ -1,8 +0,0 @@ - -type - TArray = array[0x0012..0x0013, int] - -var a: TArray - -echo a[0x0012] #OUT 0 - diff --git a/tests/lexer/tlexermisc.nim b/tests/lexer/tlexermisc.nim new file mode 100644 index 000000000..3e3993599 --- /dev/null +++ b/tests/lexer/tlexermisc.nim @@ -0,0 +1,27 @@ +discard """ + action: run + output: "equal" +""" + +var t=0x950412DE + +if t==0x950412DE: + echo "equal" +else: + echo "not equal" + +type + TArray = array[0x0012..0x0013, int] + +var a: TArray + +doAssert a[0x0012] == 0 + + +# #7884 + +type Obj = object + ö: int + +let o = Obj(ö: 1) +doAssert o.ö == 1 |