Skip to content

Commit

Permalink
add more formatters for representation
Browse files Browse the repository at this point in the history
  • Loading branch information
Boldewyn committed Mar 19, 2024
1 parent d0b6107 commit 7664fe3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/js/components/cp-representations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,25 @@ const formatters = [
return '\\'+str;
}],

['xls', _('Excel'), (n) => `=UNICHAR(${n})`],

['go', _('Go'), backslash_u_U],

['js', _('JavaScript'), jsonify],
['mjs', _('Modern JavaScript'), backslash_u_curly, _('since ES6')],
['json', _('JSON'), jsonify],
['java', _('Java'), jsonify],

['pl', _('Perl'), function(n) {
return '"\\x{'+n.toString(16).toUpperCase()+'}"';
}],
['lua', _('Lua'), (n) => `\\u{${n.toString(16).toUpperCase()}}`],

['mat', _('Matlab'), (n) => `char(${n})`],

['pl', _('Perl'), (n) => `"\\x{${n.toString(16).toUpperCase()}}"`],

['php', _('PHP'), backslash_u_curly],

['ps1', _('PowerShell'), (n) => `\`u{${n.toString(16).toUpperCase()}}`],

['py', _('Python'), backslash_u_U],

['rb', _('Ruby'), backslash_u_curly],
Expand Down

0 comments on commit 7664fe3

Please sign in to comment.