Closed krux02 closed 5 years ago
Per info from IRC, The PR is ready. I'm more than happy to merge it, @yuutayamada any objections?
Is there anything left that I need to do, before this can be merged?
I'll merge this by this weekend if no problem. (I gonna check with Nim 0.19)
Weekend is almost over by now, what do you say?
Weekend is not over yet in us
On Sun, Sep 30, 2018, 11:02 Arne Döring notifications@github.com wrote:
Weekend is almost over by now, what do you say?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nim-lang/nim-mode/pull/201#issuecomment-425739286, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCEaWX9qfYQMuBv4JxWaMSqA-L1HIggks5ugQdOgaJpZM4WmVYF .
Well, here it is now officially Monday.
I don't know what you mean. probably I should extend the term to by the Monday then.
On Sun, Sep 30, 2018, 15:06 Arne Döring notifications@github.com wrote:
Well, here it is now officially Monday.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nim-lang/nim-mode/pull/201#issuecomment-425755895, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCEadyQZP5G3OJEfICVEGHFZS07vjM6ks5ugUBLgaJpZM4WmVYF .
@krux02 thank you! I've merge your PR now.
thanks
This PR is an overall simplification and optimization of
nim-syntax.el
. All optimizations are measured with a profiler in a big file to ensure that they actually have a positive impact.changlog
nim-rx
nim-letter
is gone,letter
fromrx
is better.quoted-chars
is a much shorter regex. Better readable in string representation, probably faster.colon-type
andfont-lock-defun
are gone, they have been replaced by more precise regular expressions innim-syntax.el
nim-syntax.el
nim-format-$-matcher
uses a regular expression now.nim--convert-to-non-casesensitive
tonim--convert-to-nim-style-insensitive
, "style insensitive" is how it is referred to in the manual, and it is very nim specific.nim-matcher-func
and substitute its use cases with a simpler pattern that does not need exceptions or lambda expressions.nim-type-matcher
nim-number-matcher
nim-proc-matcher
are now regular expressions only. No need for them to be a proc.proc foo(a: A, b,c: BC): D
are all caught with the same colon type expression. Expressions such asproc foobar(a: var ptr ptr MyType)
are correctly highlighted now. The keywords beforeMyType
are not highlighted by the colon-type matcher, because they are already highlighted as keywords.proc myident*[...](...):...
. But it didn't fontify anything from the arguments or return values nor require it in the expression. So that part is cut from the regular expression.var
andproc
matcher expression now require to be the start of a statement. The start of a statement is the first non space character of the line or after a semicolon. This prevents that inproc foo(a: var MyType)
MyType
will be highlighted as an identifier.Especially in
nim-format-$-matcher
the changes have significant performance. Probably because I replaced the low level lisp logic to check if the current position matching a$N
expression with a proper regular expression that naturally has only very few false positives.