Skip to content

Commit

Permalink
Excel Formula: Use more fitting aliases for function-name, range,…
Browse files Browse the repository at this point in the history
… and `cell` (#3391)
  • Loading branch information
hoonweiting committed Mar 14, 2022
1 parent ce41434 commit ef0ec02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/prism-excel-formula.js
Expand Up @@ -39,11 +39,11 @@ Prism.languages['excel-formula'] = {
},
'function-name': {
pattern: /\b[A-Z]\w*(?=\()/i,
alias: 'keyword'
alias: 'builtin'
},
'range': {
pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,
alias: 'property',
alias: 'selector',
inside: {
'operator': /:/,
'cell': /\$?[A-Z]+\$?\d+/i,
Expand All @@ -55,7 +55,7 @@ Prism.languages['excel-formula'] = {
// Excel is case insensitive, so the string "foo1" could be either a variable or a cell.
// To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise.
pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,
alias: 'property'
alias: 'selector'
},
'number': /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,
'boolean': /\b(?:FALSE|TRUE)\b/i,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-excel-formula.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ef0ec02

Please sign in to comment.