Skip to content

Commit

Permalink
Updated the sway.js file by adding mod and type in keyword (FuelLabs#…
Browse files Browse the repository at this point in the history
…4427)

## Description
fixes FuelLabs#4424 
closes FuelLabs#4424 


## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Joshua Batty <[email protected]>
  • Loading branch information
Yasir761 and JoshuaBatty authored Apr 12, 2023
1 parent c196d20 commit 800089e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions docs/book/theme/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,16 @@ anyNumberOfTimes:g};for(const e in A)"object"==typeof A[e]&&n(A[e])
grmr_sway:e=>{const t={className:"title.function.invoke",relevance:0,
begin:b(/\b/,/(?!let\b)/,e.IDENT_RE,u(/\s*\(/))},n="([u](8|16|32|64))?";return{
name:"Sway",aliases:["sw"],keywords:{$pattern:e.IDENT_RE+"!?",
keyword:["abi","as","asm","break","const","continue","contract","dep","deref","else","enum","fn","for","if","impl","let","library","match","mut","predicate","pub","ref","return","script","Self","self","storage","str","struct","trait","use","where","while"],
keyword:["abi","as","asm","break","const","continue","contract","deref","else","enum","fn","for","if","impl","let","library","mod","match","mut","predicate","pub","ref","return","script","Self","self","storage","str","struct","type","trait","use","where","while"],
literal:["true","false","Some","None","Ok","Err"],
built_in:["bool","char","u8","u16","u32","u64","b256","str","Self"]},
illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{
contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{
className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",
begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{scope:"meta",match:/#\[.*\]/},{
className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n
},{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{scope:"meta",match:/#\[.*\]/},{
className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",
variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n},{
begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{
begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",
3:"title.function"}},{
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/theme/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,16 @@ anyNumberOfTimes:g};for(const e in A)"object"==typeof A[e]&&n(A[e])
grmr_sway:e=>{const t={className:"title.function.invoke",relevance:0,
begin:b(/\b/,/(?!let\b)/,e.IDENT_RE,u(/\s*\(/))},n="([u](8|16|32|64))?";return{
name:"Sway",aliases:["sw"],keywords:{$pattern:e.IDENT_RE+"!?",
keyword:["abi","as","asm","break","const","continue","contract","dep","deref","else","enum","fn","for","if","impl","let","library","match","mut","predicate","pub","ref","return","script","Self","self","storage","str","struct","trait","use","where","while"],
keyword:["abi","as","asm","break","const","continue","contract","deref","else","enum","fn","for","if","impl","let","library","mod","match","mut","predicate","pub","ref","return","script","Self","self","storage","str","struct","type","trait","use","where","while"],
literal:["true","false","Some","None","Ok","Err"],
built_in:["bool","char","u8","u16","u32","u64","b256","str","Self"]},
illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{
contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{
className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",
begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{scope:"meta",match:/#\[.*\]/},{
className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n
},{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{scope:"meta",match:/#\[.*\]/},{
className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",
variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n},{
begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{
begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",
3:"title.function"}},{
Expand Down
10 changes: 5 additions & 5 deletions forc-plugins/forc-doc/src/assets/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,16 @@ anyNumberOfTimes:g};for(const e in A)"object"==typeof A[e]&&n(A[e])
grmr_sway:e=>{const t={className:"title.function.invoke",relevance:0,
begin:b(/\b/,/(?!let\b)/,e.IDENT_RE,u(/\s*\(/))},n="([u](8|16|32|64))?";return{
name:"Sway",aliases:["sw"],keywords:{$pattern:e.IDENT_RE+"!?",
keyword:["abi","as","asm","break","const","continue","contract","dep","deref","else","enum","fn","for","if","impl","let","library","match","mut","predicate","pub","ref","return","script","Self","self","storage","str","struct","trait","use","where","while"],
keyword:["abi","as","asm","break","const","continue","contract","deref","else","enum","fn","for","if","impl","let","library","mod","match","mut","predicate","pub","ref","return","script","Self","self","storage","str","struct","type","trait","use","where","while"],
literal:["true","false","Some","None","Ok","Err"],
built_in:["bool","char","u8","u16","u32","u64","b256","str","Self"]},
illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{
contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{
className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",
begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{scope:"meta",match:/#\[.*\]/},{
className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n
},{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{scope:"meta",match:/#\[.*\]/},{
className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",
variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n},{
begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{
begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",
3:"title.function"}},{
Expand Down
3 changes: 2 additions & 1 deletion scripts/highlightjs/sway.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default function(hljs) {
"const",
"continue",
"contract",
"dep",
"deref",
"else",
"enum",
Expand All @@ -39,6 +38,7 @@ export default function(hljs) {
"impl",
"let",
"library",
"mod",
"match",
"mut",
"predicate",
Expand All @@ -51,6 +51,7 @@ export default function(hljs) {
"storage",
"str",
"struct",
"type",
"trait",
"use",
"where",
Expand Down

0 comments on commit 800089e

Please sign in to comment.