Skip to content

Commit

Permalink
fix: DTStack#121 customParams use identifier highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Apr 22, 2024
1 parent bfb368e commit 0820b6a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/languages/hive/hive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@customParams' },
{ include: '@numbers' },
{ include: '@strings' },
{ include: '@complexIdentifiers' },
Expand Down Expand Up @@ -554,6 +555,10 @@ export const language = <languages.IMonarchLanguage>{
}
]
],
customParams: [
[/\${[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE],
[/\@\@{[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE]
],
numbers: [
[/0[xX][0-9a-fA-F]*/, TokenClassConsts.NUMBER_HEX],
[/[$][+-]*\d*(\.\d*)?/, TokenClassConsts.NUMBER],
Expand Down
5 changes: 5 additions & 0 deletions src/languages/impala/impala.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@customParams' },
{ include: '@numbers' },
{ include: '@strings' },
{ include: '@complexIdentifiers' },
Expand Down Expand Up @@ -501,6 +502,10 @@ export const language = <languages.IMonarchLanguage>{
[/./, TokenClassConsts.COMMENT]
],
pseudoColumns: [],
customParams: [
[/\${[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE],
[/\@\@{[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE]
],
numbers: [
[/0[xX][0-9a-fA-F]*/, TokenClassConsts.NUMBER_HEX],
[/[$][+-]*\d*(\.\d*)?/, TokenClassConsts.NUMBER],
Expand Down
5 changes: 5 additions & 0 deletions src/languages/mysql/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@customParams' },
{ include: '@numbers' },
{ include: '@strings' },
{ include: '@complexIdentifiers' },
Expand Down Expand Up @@ -953,6 +954,10 @@ export const language = <languages.IMonarchLanguage>{
}
]
],
customParams: [
[/\${[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE],
[/\@\@{[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE]
],
numbers: [
[/0[xX][0-9a-fA-F]*/, TokenClassConsts.NUMBER_HEX],
[/[$][+-]*\d*(\.\d*)?/, TokenClassConsts.NUMBER],
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pgsql/pgsql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@customParams' },
{ include: '@numbers' },
{ include: '@strings' },
{ include: '@complexIdentifiers' },
Expand Down Expand Up @@ -1006,6 +1007,10 @@ export const language = <languages.IMonarchLanguage>{
pseudoColumns: [
// Not support
],
customParams: [
[/\${[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE],
[/\@\@{[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE]
],
numbers: [
[/0[xX][0-9a-fA-F]*/, TokenClassConsts.NUMBER_HEX],
[/[$][+-]*\d*(\.\d*)?/, TokenClassConsts.NUMBER],
Expand Down
5 changes: 5 additions & 0 deletions src/languages/spark/spark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@customParams' },
{ include: '@numbers' },
{ include: '@binaries' },
{ include: '@strings' },
Expand Down Expand Up @@ -730,6 +731,10 @@ export const language = <languages.IMonarchLanguage>{
}
]
],
customParams: [
[/\${[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE],
[/\@\@{[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE]
],
numbers: [
// https://spark.apache.org/docs/latest/sql-ref-literals.html#numeric-literal
// TODO: Fractional Literals Syntax
Expand Down
5 changes: 5 additions & 0 deletions src/languages/trino/trino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@customParams' },
{ include: '@numbers' },
{ include: '@strings' },
{ include: '@complexIdentifiers' },
Expand Down Expand Up @@ -674,6 +675,10 @@ export const language = <languages.IMonarchLanguage>{
}
]
],
customParams: [
[/\${[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE],
[/\@\@{[A-Za-z0-9._-]*}/, TokenClassConsts.VARIABLE]
],
numbers: [
[/[$][+-]*\d*(\.\d*)?/, TokenClassConsts.NUMBER],
[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, TokenClassConsts.NUMBER]
Expand Down

0 comments on commit 0820b6a

Please sign in to comment.