Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite JavaScript syntax highlighting #13

Merged
merged 2 commits into from
Sep 13, 2014

Conversation

iarna
Copy link
Contributor

@iarna iarna commented Aug 30, 2014

  • Fixes bug that made division get marked up as regexp
  • Highlights assignment to differentiate it from equality checks
  • Adds a bunch of new highlighting categories (no color changes by default however)
  • More syntax errors will be marked as bad (multi-line strings, multiple identifiers in a row, etc)
  • Single and double quotes correctly treated the same
  • Ident's can include $

@iarna iarna force-pushed the rewrite-js-highlighter branch 11 times, most recently from 9c01ba1 to d48aa45 Compare September 3, 2014 16:43
@iarna
Copy link
Contributor Author

iarna commented Sep 12, 2014

Incidentally, the colors I personally use for JS are included below. They're rather less colorful than the defaults, so YMMV. They're also using 256-color xterm support.

=Idle
=Comment        fg_010
=CommentLabel   bold fg_030
=Constant       fg_343
=String         fg_244
=StringEscape   bold fg_055
=Regexp         fg_244
=RegexpEscape   bold fg_155
=RegexpOptions  fg_255
=Number         fg_244
=Type
=CustomType
=Keyword
=Global         bold fg_444
=Exports        fg_112
=ExportItem     fg_225
=Operator
=Bad            inverse bold red  
=Brace          fg_331
=Assign         fg_331 bold
=Paren          fg_111
=Bracket        fg_111
=Semicolon      fg_111
=Comma          fg_111
=PropSep        fg_111
=Syntax         fg_555
=Ident
=Method

@cmur2
Copy link
Owner

cmur2 commented Sep 12, 2014

Thank you, esp. for this massive contribution! Should I merge this already since you're doing some adjustments from time to time?

One thing worrying me is the changed indentation/number of tabs between the "columns" which clutters the diff... do they align better in your editor? I'm using tabs with 4 spaces which works ok except on long (but rare) labels.

@iarna
Copy link
Contributor Author

iarna commented Sep 12, 2014

So, there were some sections that used spaces instead of tabs previously, some places where it was mixed. I changed it to be consistent and only use tabs.

The ftyperc in this repo configures jsf files to use 8 space tabs, so that's what I used.

@iarna
Copy link
Contributor Author

iarna commented Sep 12, 2014

As far as my ongoing changes are concerned, please feel free to merge any time. It's at least as complete as the previous version, with some obvious deficiencies corrected.

I'm happy to make anything new beyond this a new pull request.

@cmur2
Copy link
Owner

cmur2 commented Sep 13, 2014

Regarding the tabs I described the problem I saw in the wrong way: see for example this line (iarna@f763aca#diff-f9866eba4b16d6cd9795eaefa29024adR494), you didn't changed the semantics but there is one tab more in it now that makes it into the (whitespace) diff and I wondered why. Sure there are some longer character lists esp. in the keyword list but often the lists are really short...

@iarna
Copy link
Contributor Author

iarna commented Sep 13, 2014

Oh, I see what you mean… I've added a commit that undoes that and otherwise makes the columns more consistent.

cmur2 pushed a commit that referenced this pull request Sep 13, 2014
Rewrite JavaScript syntax highlighting
@cmur2 cmur2 merged commit 8fdee52 into cmur2:master Sep 13, 2014
@iarna iarna deleted the rewrite-js-highlighter branch October 8, 2014 09:20
@cmur2
Copy link
Owner

cmur2 commented Mar 3, 2015

And the same question regarding GPL v2 goes for your big contribution here :)

@iarna
Copy link
Contributor Author

iarna commented Mar 3, 2015

Absolutely. In fact, dual licensed, GPL v2 and ISC:

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

@cmur2
Copy link
Owner

cmur2 commented Mar 10, 2015

Might you extend your statement to "GPL v2 or any later version"? The original JOE project evaluated their licensing situation and would like to have the any-later-version option to be better prepared for future developments... I already updated this for myself in the README.

@utoddl
Copy link
Contributor

utoddl commented Mar 10, 2015

Christian,

It's not clear to me exactly whom you are asking, but certainly from my
perspective, any contributions you may have from me are "GPL v2 or any
later version". -- Todd Lewis (utoddl@email.unc.edu and/or todd_lewis@unc.edu)

On 03/10/2015 07:27 AM, Christian Nicolai wrote:

Might you extend your statement to "GPL v2 or any later version"? The
original JOE project evaluated their licensing situation and would like
to have the any-later-version option to be better prepared for future
developments... I already updated this for myself in the README.


Reply to this email directly or view it on GitHub
#13 (comment).

+--------------------------------------------------------------+
/ Todd_Lewis@unc.edu 919-445-0091 http://www.unc.edu/~utoddl /
/ He had a photographic memory which was never developed. /
+--------------------------------------------------------------+

@cmur2
Copy link
Owner

cmur2 commented Mar 10, 2015

@utoddl oh, this question was supposed to be directed to @iarna but thanks for your positive response anyways!

@iarna
Copy link
Contributor Author

iarna commented Mar 10, 2015

Ok then, ANY GPL, plus the GPL compatible ISC.

@cmur2
Copy link
Owner

cmur2 commented Mar 10, 2015

Big thanks! Hopefully that's the last request for this matter...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants