-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add syntax highlighting in the REPL
PR-URL: #2254 Resolves: #2072 --------- Signed-off-by: Snehil Shah <snehilshah.989@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
- Loading branch information
1 parent
d3215eb
commit 24f4a8f
Showing
8 changed files
with
834 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2024 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// MAIN // | ||
|
||
/** | ||
* Table mapping generic color names to their ANSI color codes. | ||
* | ||
* @private | ||
* @name ANSI | ||
* @type {Object} | ||
*/ | ||
var ANSI = { | ||
// Original colors: | ||
'black': '\u001b[30m', | ||
'red': '\u001b[31m', | ||
'green': '\u001b[32m', | ||
'yellow': '\u001b[33m', | ||
'blue': '\u001b[34m', | ||
'magenta': '\u001b[35m', | ||
'cyan': '\u001b[36m', | ||
'white': '\u001b[37m', | ||
|
||
// Bright colors: | ||
'brightBlack': '\u001b[90m', | ||
'brightRed': '\u001b[91m', | ||
'brightGreen': '\u001b[92m', | ||
'brightYellow': '\u001b[93m', | ||
'brightBlue': '\u001b[94m', | ||
'brightMagenta': '\u001b[95m', | ||
'brightCyan': '\u001b[96m', | ||
'brightWhite': '\u001b[97m', | ||
|
||
// Reset colors: | ||
'reset': '\u001b[0m' | ||
}; | ||
|
||
|
||
// EXPORTS // | ||
|
||
module.exports = ANSI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.