Skip to content

Commit

Permalink
add support for ReScript
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnobip committed Jul 31, 2023
1 parent 7217810 commit 7c6b6f6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Raku (raku,rakumod,rakutest,rakudoc,t)
Razor (cshtml,razor)
ReasonML (re,rei)
Report Definition Language (rdl)
ReScript (res,resi)
ReStructuredText (rst)
Robot Framework (robot)
Ruby (rb)
Expand Down
35 changes: 35 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5892,6 +5892,41 @@
],
"quotes": []
},
"ReScript": {
"complexitychecks": [
"for ",
"for(",
"if ",
"if(",
"switch ",
"while ",
"else ",
"|| ",
"&& ",
"!= ",

This comment has been minimized.

Copy link
@DZakh

DZakh Aug 1, 2023

@tsnobip There's also !==

This comment has been minimized.

Copy link
@tsnobip

tsnobip Aug 1, 2023

Author Contributor

@DZakh yes you could add !== too indeed, but to be honest, I think what would have a bigger impact on complexity calculation is to add | for pattern matching, which is much more common in most rescript code bases compared to equality operators, the only downside I see is that it would also take into accounts type definition, but it's probably negligible.
Maybe we should move this discussion to an issue in this repo or maybe even better to a post on rescript forum?

"== ",
"=== "
],
"extensions": [
"res",
"resi"
],
"line_comment": [
"//"
],
"multi_line": [
[
"/*",
"*/"
]
],
"quotes": [
{
"end": "\"",

This comment has been minimized.

Copy link
@DZakh

DZakh Aug 1, 2023

@tsnobip There are also ` quotes

This comment has been minimized.

Copy link
@DZakh

DZakh Aug 1, 2023

And ' for char, but I'm not sure that it should be here

This comment has been minimized.

Copy link
@tsnobip

tsnobip Aug 1, 2023

Author Contributor

I'm not sure ' has any use except from legacy since chars don't mean much in JS.

I thought about the ` quotes so I checked and they're not present in the JS/TS specs either, so I decided to keep it like this since I have very little knowledge about SCC itself.

"start": "\""
}
]
},
"ReStructuredText": {
"complexitychecks": [],
"extensions": [
Expand Down
4 changes: 2 additions & 2 deletions processor/constants.go

Large diffs are not rendered by default.

0 comments on commit 7c6b6f6

Please sign in to comment.