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

Erlang/OTP 27 enhancements #4063

Merged
merged 9 commits into from
Jul 13, 2024
Merged

Conversation

nixxquality
Copy link
Contributor

@nixxquality nixxquality commented Jun 7, 2024

Changes

Erlang/OTP version 27 carried a bunch of syntax enhancements.
They are summarized over on their blog: https://www.erlang.org/blog/highlights-otp-27/
I've split up each feature into its own commit so far.

These are:

  • Triple-quoted strings
  • doc attribute
  • Sigil type
  • maybe statement

Checklist

  • Added markup tests
  • Updated the changelog at CHANGES.md

Please let me know how it looks.

Copy link

github-actions bot commented Jun 7, 2024

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +446 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB +1 B
es/highlight.min.js 8.2 KB 8.2 KB +1 B
es/languages/erlang.min.js 1.07 KB 1.29 KB +222 B
highlight.min.js 8.23 KB 8.23 KB +1 B
languages/erlang.min.js 1.08 KB 1.3 KB +221 B

src/languages/erlang.js Outdated Show resolved Hide resolved
src/languages/erlang.js Outdated Show resolved Hide resolved
Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +477 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB +3 B
es/highlight.min.js 8.2 KB 8.2 KB +3 B
es/languages/erlang.min.js 1.07 KB 1.3 KB +234 B
highlight.min.js 8.23 KB 8.23 KB +3 B
languages/erlang.min.js 1.08 KB 1.31 KB +234 B

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +455 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB +4 B
es/highlight.min.js 8.2 KB 8.2 KB +4 B
es/languages/erlang.min.js 1.07 KB 1.29 KB +222 B
highlight.min.js 8.23 KB 8.23 KB +4 B
languages/erlang.min.js 1.08 KB 1.3 KB +221 B

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +429 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB +1 B
es/highlight.min.js 8.2 KB 8.2 KB +1 B
es/languages/erlang.min.js 1.07 KB 1.28 KB +213 B
highlight.min.js 8.23 KB 8.23 KB +2 B
languages/erlang.min.js 1.08 KB 1.29 KB +212 B

Copy link

github-actions bot commented Jul 9, 2024

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +324 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB +2 B
es/highlight.min.js 8.2 KB 8.2 KB +2 B
es/languages/erlang.min.js 1.07 KB 1.23 KB +159 B
highlight.min.js 8.23 KB 8.23 KB +2 B
languages/erlang.min.js 1.08 KB 1.24 KB +159 B

match: /"""("*)(?!")(.|\n)*?"""\1/,
match: /"""("*)(?!")[\s\S]*?"""\1/,
Copy link
Member

Choose a reason for hiding this comment

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

What's the nuance here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just looking at the code for the BACKSLASH_ESCAPE and I thought it made a bit more sense than (.|\n).

@nixxquality
Copy link
Contributor Author

Taking a look at the failing tests now. I was sure I ran a check before I pushed...

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +304 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB -2 B
es/highlight.min.js 8.2 KB 8.2 KB -2 B
es/languages/erlang.min.js 1.07 KB 1.23 KB +156 B
highlight.min.js 8.23 KB 8.23 KB -3 B
languages/erlang.min.js 1.08 KB 1.23 KB +155 B

@nixxquality
Copy link
Contributor Author

nixxquality commented Jul 11, 2024

Silly mistake, after I made sure everything worked I went ahead and sorted the variants like the documentation

Immediately after follows the sigil content; a character sequence between content delimiters. The allowed delimiters are these start-end delimiter pairs: () [] {} <>, or these characters that are both start and end delimiters: / | ' " ` #. Triple-quote string delimiters may also be used.

But placing the triple-quote matcher at the end made it prioritise the regular "" matcher above it.

@joshgoebel
Copy link
Member

Looking good. Rebase and add changelog?

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +305 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB -2 B
es/highlight.min.js 8.2 KB 8.2 KB -2 B
es/languages/erlang.min.js 1.07 KB 1.23 KB +156 B
highlight.min.js 8.23 KB 8.23 KB -2 B
languages/erlang.min.js 1.08 KB 1.23 KB +155 B

@nixxquality
Copy link
Contributor Author

I hope that looks good.

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +308 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB -1 B
es/highlight.min.js 8.2 KB 8.2 KB -1 B
es/languages/erlang.min.js 1.07 KB 1.23 KB +156 B
highlight.min.js 8.23 KB 8.23 KB -1 B
languages/erlang.min.js 1.08 KB 1.23 KB +155 B

CHANGES.md Show resolved Hide resolved
Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +308 B

View Changes
file base pr diff
es/core.min.js 8.2 KB 8.2 KB -1 B
es/highlight.min.js 8.2 KB 8.2 KB -1 B
es/languages/erlang.min.js 1.07 KB 1.23 KB +156 B
highlight.min.js 8.23 KB 8.23 KB -1 B
languages/erlang.min.js 1.08 KB 1.23 KB +155 B

@joshgoebel joshgoebel merged commit 9267f50 into highlightjs:main Jul 13, 2024
19 checks passed
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.

2 participants