forked from EnlighterJS/EnlighterJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split sql language support into multiple subsets/dialects
- Loading branch information
1 parent
4419718
commit 339ebf8
Showing
8 changed files
with
146 additions
and
18 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// ---------------------------------------------------------------------- | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// -- | ||
// Copyright 2016-2020 Andi Dittrich <https://andidittrich.de> | ||
// ---------------------------------------------------------------------- | ||
|
||
// Generic Rules/Regex | ||
import _language_common_rules from './rulesets/generic'; | ||
import {sql} from './sql'; | ||
|
||
// MariaDB MySQL Syntax | ||
// Author: [Andi Dittrich] | ||
// -- | ||
export class mariadb extends sql { | ||
|
||
// language aliases | ||
static alias(){ | ||
return ['mysql']; | ||
} | ||
|
||
setupLanguage(){ | ||
// setup css | ||
super.setupLanguage(); | ||
|
||
// addon rules | ||
const addonRules = [ | ||
// single line comments | ||
_language_common_rules.poundComments, | ||
|
||
// static numeric types | ||
{ | ||
regex: /\b(tinyint|smallint|mediumint|bigint|int|integer|boolean|decimal|number|float|double|bit|double precision|real|dec|numeric|fixed)\b/g, | ||
type: 'k5' | ||
}, | ||
|
||
// qualifier/modifier | ||
{ | ||
regex: /\b(unsigned|signed|zerofill)\b/g, | ||
type: 'k8' | ||
} | ||
|
||
]; | ||
|
||
// push to css rule-set | ||
this.rules = this.rules.concat(addonRules); | ||
} | ||
} |
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,29 @@ | ||
// ---------------------------------------------------------------------- | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// -- | ||
// Copyright 2016-2020 Andi Dittrich <https://andidittrich.com> | ||
// ---------------------------------------------------------------------- | ||
|
||
// Generic Rules/Regex | ||
//import _language_common_rules from './rulesets/generic'; | ||
import {sql} from './sql'; | ||
|
||
// Oracle Database Syntax | ||
// Author: [Andi Dittrich] | ||
// -- | ||
export class mssql extends sql { | ||
|
||
setupLanguage(){ | ||
// setup css | ||
super.setupLanguage(); | ||
|
||
// addon rules | ||
const addonRules = [ | ||
]; | ||
|
||
// push to css rule-set | ||
this.rules = this.rules.concat(addonRules); | ||
} | ||
} |
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,34 @@ | ||
// ---------------------------------------------------------------------- | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// -- | ||
// Copyright 2016-2020 Andi Dittrich <https://andidittrich.com> | ||
// ---------------------------------------------------------------------- | ||
|
||
// Generic Rules/Regex | ||
//import _language_common_rules from './rulesets/generic'; | ||
import {sql} from './sql'; | ||
|
||
// Oracle Database Syntax | ||
// Author: [Andi Dittrich] | ||
// -- | ||
export class oracledb extends sql { | ||
|
||
// language aliases | ||
static alias(){ | ||
return ['oracle']; | ||
} | ||
|
||
setupLanguage(){ | ||
// setup css | ||
super.setupLanguage(); | ||
|
||
// addon rules | ||
const addonRules = [ | ||
]; | ||
|
||
// push to css rule-set | ||
this.rules = this.rules.concat(addonRules); | ||
} | ||
} |
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