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

add json5 mode #4116

Merged
merged 1 commit into from
Nov 21, 2019
Merged

add json5 mode #4116

merged 1 commit into from
Nov 21, 2019

Conversation

nightwing
Copy link
Member

fixes #4096

var startRules = [
{
token : "variable",
regex : /(?<=[{\s]|^)[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/
Copy link
Contributor

Choose a reason for hiding this comment

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

Test fails due to use of a lookbehind assertion

error Parsing error: Invalid regular expression: /(?<=[{\s]|^)[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]\s(?=:)/: Invalid group

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I had forgotten that lookbehind is now supported in chrome.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's pretty wonderful, but hard to support in other browsers :(

@codecov
Copy link

codecov bot commented Nov 21, 2019

Codecov Report

Merging #4116 into master will increase coverage by 0.01%.
The diff coverage is 96.96%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4116      +/-   ##
=========================================
+ Coverage   70.49%   70.5%   +0.01%     
=========================================
  Files         521     523       +2     
  Lines       51115   51148      +33     
  Branches     9622    9622              
=========================================
+ Hits        36031   36064      +33     
  Misses      15084   15084
Impacted Files Coverage Δ
lib/ace/mode/json5_highlight_rules.js 100% <100%> (ø)
lib/ace/mode/json5.js 95.45% <95.45%> (ø)
lib/ace/editor.js 78.82% <0%> (-0.08%) ⬇️
lib/ace/virtual_renderer.js 79.41% <0%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec179f7...0ee8313. Read the comment docs.

@nightwing nightwing merged commit 78c6d81 into master Nov 21, 2019
@nightwing nightwing deleted the json5 branch November 21, 2019 16:11
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.

Any plan on support json5 mode?
2 participants