From 08db4d86352f05d8aafcefde3f5e196951c35616 Mon Sep 17 00:00:00 2001 From: Jad Altahan Date: Wed, 30 Jan 2019 11:35:01 +1100 Subject: Backport: Feature [feature-requests:#1261]. Enhance the styling of backticks in Nim Backport of changeset 7244:a5c65813871a. --- test/examples/x.nim | 6 ++++++ test/examples/x.nim.styled | 6 ++++++ test/lexTests.py | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/examples/x.nim b/test/examples/x.nim index 07c9d216f..4bf0de737 100644 --- a/test/examples/x.nim +++ b/test/examples/x.nim @@ -4,3 +4,9 @@ let s = "foobar" # Feature #1260 {.ident.} stdin.readLine.split.map(parseInt).max.`$`.echo(" is the maximum!") + +# Feature #1261 +# IsFuncName("proc") so style ticks as SCE_NIM_FUNCNAME: +proc `$` (x: myDataType): string = ... +# Style ticks as SCE_NIM_BACKTICKS: +if `==`( `+`(3,4),7): echo "True" diff --git a/test/examples/x.nim.styled b/test/examples/x.nim.styled index fc1532e60..18ae529e6 100644 --- a/test/examples/x.nim.styled +++ b/test/examples/x.nim.styled @@ -4,3 +4,9 @@ {3}# Feature #1260 {15}{.{16}ident{15}.}{0} {16}stdin{15}.{16}readLine{15}.{16}split{15}.{16}map{15}({16}parseInt{15}).{16}max{15}.{11}`$`{15}.{16}echo{15}({6}" is the maximum!"{15}){0} + +{3}# Feature #1261 +# IsFuncName("proc") so style ticks as SCE_NIM_FUNCNAME: +{8}proc{0} {12}`$`{0} {15}({16}x{15}:{0} {16}myDataType{15}):{0} {16}string{0} {15}={0} {15}...{0} +{3}# Style ticks as SCE_NIM_BACKTICKS: +{8}if{0} {11}`==`{15}({0} {11}`+`{15}({5}3{15},{5}4{15}),{5}7{15}):{0} {16}echo{0} {6}"True"{0} diff --git a/test/lexTests.py b/test/lexTests.py index eb38b7af7..46e4eb4fb 100644 --- a/test/lexTests.py +++ b/test/lexTests.py @@ -157,7 +157,7 @@ class TestLexers(unittest.TestCase): self.LexExample("x.lua", b"lua", [b"function end"]) def testNim(self): - self.LexExample("x.nim", b"nim", [b"else end if let"]) + self.LexExample("x.nim", b"nim", [b"else end if let proc"]) def testRuby(self): self.LexExample("x.rb", b"ruby", [b"class def end"]) -- cgit v1.2.3