feat: add Bracket, Comma, and FunctionArguments tokens
This commit is contained in:
parent
5404cdd4d0
commit
b1ae454ae4
@ -6,7 +6,6 @@ export enum TokenType {
|
|||||||
SingleQuotation = 'SingleQuotation',
|
SingleQuotation = 'SingleQuotation',
|
||||||
DoubleQuotation = 'DoubleQuotation',
|
DoubleQuotation = 'DoubleQuotation',
|
||||||
BackQuotation = 'BackQuotation',
|
BackQuotation = 'BackQuotation',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Language element type
|
* Language element type
|
||||||
*/
|
*/
|
||||||
@ -16,11 +15,20 @@ export enum TokenType {
|
|||||||
* Statement
|
* Statement
|
||||||
*/
|
*/
|
||||||
StatementTerminator = 'StatementTerminator',
|
StatementTerminator = 'StatementTerminator',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Others
|
* Others
|
||||||
*/
|
*/
|
||||||
Error = 'Error'
|
Error = 'Error',
|
||||||
|
/**
|
||||||
|
* Left small Bracket
|
||||||
|
*/
|
||||||
|
LeftSmallBracket = 'LeftSmallBracket',
|
||||||
|
/**
|
||||||
|
* Left small Bracket
|
||||||
|
*/
|
||||||
|
RightSmallBracket = 'RightSmallBracket',
|
||||||
|
Comma = 'Comma',
|
||||||
|
FunctionArguments = 'FunctionArguments'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +48,10 @@ export interface Token {
|
|||||||
*/
|
*/
|
||||||
export const TokenReg = {
|
export const TokenReg = {
|
||||||
[TokenType.StatementTerminator]: /[;]/,
|
[TokenType.StatementTerminator]: /[;]/,
|
||||||
[TokenType.SingleQuotation]: /[']/,
|
[TokenType.SingleQuotation]: /['|\']/,
|
||||||
[TokenType.DoubleQuotation]: /["]/,
|
[TokenType.DoubleQuotation]: /["]/,
|
||||||
[TokenType.BackQuotation]: /[`]/,
|
[TokenType.BackQuotation]: /[`]/,
|
||||||
|
[TokenType.LeftSmallBracket]: /[(]/,
|
||||||
|
[TokenType.RightSmallBracket]: /[)]/,
|
||||||
|
[TokenType.Comma]: /[,]/,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user