Skip to content

Commit

Permalink
Updating whitespace type to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRayCode committed Jun 20, 2023
1 parent 1893294 commit 70259f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"engines": {
"node": ">=16"
},
"version": "1.4.1",
"version": "1.4.2",
"description": "A GLSL ES 1.0 and 3.0 parser and preprocessor that can preserve whitespace and comments",
"scripts": {
"prepare": "npm run build && ./prepublish.sh",
Expand Down
18 changes: 10 additions & 8 deletions src/ast/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@ export interface BaseNode {
location?: LocationObject;
}

type Whitespace = string | string[];

export interface LiteralNode extends BaseNode {
type: 'literal';
literal: string;
whitespace: string | string[];
whitespace: Whitespace;
}

export interface KeywordNode extends BaseNode {
type: 'keyword';
token: string;
whitespace: string | string[];
whitespace: Whitespace;
}

export interface IdentifierNode extends BaseNode {
type: 'identifier';
identifier: string;
whitespace: string;
whitespace: Whitespace;
}

export interface ArraySpecifierNode extends BaseNode {
Expand Down Expand Up @@ -62,7 +64,7 @@ export interface BinaryNode extends BaseNode {
export interface BoolConstantNode extends BaseNode {
type: 'bool_constant';
token: string;
whitespace: string;
whitespace: Whitespace;
}

export interface BreakStatementNode extends BaseNode {
Expand Down Expand Up @@ -140,7 +142,7 @@ export interface DoStatementNode extends BaseNode {
export interface DoubleConstantNode extends BaseNode {
type: 'double_constant';
token: string;
whitespace: string;
whitespace: Whitespace;
}

export interface ExpressionStatementNode extends BaseNode {
Expand All @@ -158,7 +160,7 @@ export interface FieldSelectionNode extends BaseNode {
export interface FloatConstantNode extends BaseNode {
type: 'float_constant';
token: string;
whitespace: string;
whitespace: Whitespace;
}

export interface ForStatementNode extends BaseNode {
Expand Down Expand Up @@ -237,7 +239,7 @@ export interface InitializerListNode extends BaseNode {
export interface IntConstantNode extends BaseNode {
type: 'int_constant';
token: string;
whitespace: string;
whitespace: Whitespace;
}

export interface InterfaceDeclaratorNode extends BaseNode {
Expand Down Expand Up @@ -393,7 +395,7 @@ export interface TypeSpecifierNode extends BaseNode {
export interface UintConstantNode extends BaseNode {
type: 'uint_constant';
token: string;
whitespace: string;
whitespace: Whitespace;
}

export interface UnaryNode extends BaseNode {
Expand Down

0 comments on commit 70259f7

Please sign in to comment.