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

(VB.Net) Date literals, Directives, Comments, test cases #2808

Merged
merged 15 commits into from Nov 23, 2020

Conversation

Hirse
Copy link
Contributor

@Hirse Hirse commented Oct 31, 2020

Resolves #2775, resolves #2875, resolves #2851

Changes

Checklist

  • Added markup tests
  • Updated the changelog at CHANGES.md
  • Added myself to AUTHORS.txt, under Contributors Already there 😉

@Hirse
Copy link
Contributor Author

Hirse commented Oct 31, 2020

The Microsoft Docs site seems to use a fork of HLJS (v9) which adds support for date literals ...
Microsoft Docs - VB.Net date literals

... but breaks Directives (by looking for the ending #).
Microsoft Docs - VB.Net Directives

Both of which should now work as expected.
HLJS VB.Net after fix

CHANGES.md Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
@joshgoebel joshgoebel added this to the 10.4 milestone Oct 31, 2020
@joshgoebel joshgoebel added the hacktoberfest-accepted Hacktoberfest label Oct 31, 2020
@joshgoebel
Copy link
Member

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/date-data-type

You must enclose a Date literal within number signs (# #). You must specify the date value in the format M/d/yyyy, for example #5/31/1993#, or yyyy-MM-dd, for example #1993-5-31#. You can use slashes when specifying the year first. This requirement is independent of your locale and your computer's date and time format settings.

So I think that means we can have two variants for each of the possible date literals.

@joshgoebel joshgoebel added the WIP label Nov 3, 2020
@joshgoebel joshgoebel removed this from the 10.4 milestone Nov 6, 2020
Hirse and others added 4 commits November 16, 2020 21:12
Co-authored-by: Josh Goebel <me@joshgoebel.com>
Co-authored-by: Josh Goebel <me@joshgoebel.com>
@joshgoebel
Copy link
Member

This could land in 10.4 if you have time to finish it up soon.

@Hirse
Copy link
Contributor Author

Hirse commented Nov 17, 2020

I'm working on it. 😄

src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
@joshgoebel
Copy link
Member

Awesome this is looking pretty good.

src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
@Hirse Hirse changed the title (VB.Net) Date literals, Directives, test cases (VB.Net) Date literals, Directives, Comments, test cases Nov 22, 2020
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
src/languages/vbnet.js Outdated Show resolved Hide resolved
Copy link
Member

@joshgoebel joshgoebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those 3 things are it. Looking pretty awesome. :-)

src/languages/vbnet.js Outdated Show resolved Hide resolved
Copy link
Member

@joshgoebel joshgoebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the float tests I added all still valid? We had cases we weren't covering.

I simplified the date/time stuff a little with the helpers we have.

@Hirse
Copy link
Contributor Author

Hirse commented Nov 23, 2020

Yes, the tests look good.

@joshgoebel joshgoebel merged commit 7ae8127 into highlightjs:master Nov 23, 2020
@joshgoebel
Copy link
Member

@Hirse Thanks for all the hard work and closing 3 issues!!!

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