Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dot-language-support

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-language-support - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

118

lib/parser.d.ts

@@ -10,3 +10,3 @@ import { Scanner } from "./scanner";

QuotedTextIdentifierConcatenation = 5,
Count = 6,
Count = 6
}

@@ -24,63 +24,63 @@ export declare class Parser {

constructor();
private resetState();
private nextToken();
private token();
private getLinesFromFile(sourceText);
private resetState;
private nextToken;
private token;
private getLinesFromFile;
parse(sourceText: string): SourceFile;
private parseGraph();
private parseIdentifier();
private registerIdentifier(id);
private parseTextIdentifier();
private parseQuotedTextIdentifierConcatenation();
private parseQuotedTextIdentifier();
private isQuotedStringFollowing();
private parseHtmlIdentifier();
private parseNumericIdentifier();
private parseStatement();
private parseAttributeStatement();
private parseAttributeContainer();
private isAssignmentStart();
private parseIdEqualsIdStatement();
private isIdEqualsIdStatement();
private parseNodeStatement();
private parseEdgeStatement(preceedingItem);
private parseEdgeRhs();
private createMissingNode<T>(kind);
private parseAssignment();
private parseSubGraph();
private parseNodeId();
private parseCompassPointDeclaration();
private parseNormalPointDeclaration();
private parsePointDeclaration();
private isCompassPoint();
private parseList<T>(context, parseElement, atLeastOne?);
private getContextParseError(context);
private isInSomeParsingContext();
private abortListParsing(context);
private isListElement(context, inErrorRecovery);
private isListTerminator(context);
private createEmptyArray<T>();
private finishNode<T>(node, end?);
private createNode(kind, pos?);
private createNodeArray<T>(elements, pos, end?);
private parseTokenNode<T>();
private getLastError(diagnostics);
private parseErrorAtPosition(start, end, message, code);
private parseErrorAtCurrentToken(message, sub);
private scanError(message, category, sub, length);
private reportExpectedError<T>(expectedKinds);
private parseExpectedOneOf<T>(...kinds);
private parseExpectedTokenOneOf<T>(fallback, kinds);
private parseExpectedToken<T>(kind);
private parseExpected<T>(kind);
private parseOptionalToken<T>(t);
private parseOptional<T>(t);
private isEdgeOp();
private isIdentifier();
private isCompassPointKind(kind);
private speculationHelper(callback, isLookAhead);
private lookAhead(callback);
private tryParse(callback);
private parseGraph;
private parseIdentifier;
private registerIdentifier;
private parseTextIdentifier;
private parseQuotedTextIdentifierConcatenation;
private parseQuotedTextIdentifier;
private isQuotedStringFollowing;
private parseHtmlIdentifier;
private parseNumericIdentifier;
private parseStatement;
private parseAttributeStatement;
private parseAttributeContainer;
private isAssignmentStart;
private parseIdEqualsIdStatement;
private isIdEqualsIdStatement;
private parseNodeStatement;
private parseEdgeStatement;
private parseEdgeRhs;
private createMissingNode;
private parseAssignment;
private parseSubGraph;
private parseNodeId;
private parseCompassPointDeclaration;
private parseNormalPointDeclaration;
private parsePointDeclaration;
private isCompassPoint;
private parseList;
private getContextParseError;
private isInSomeParsingContext;
private abortListParsing;
private isListElement;
private isListTerminator;
private createEmptyArray;
private finishNode;
private createNode;
private createNodeArray;
private parseTokenNode;
private getLastError;
private parseErrorAtPosition;
private parseErrorAtCurrentToken;
private scanError;
private reportExpectedError;
private parseExpectedOneOf;
private parseExpectedTokenOneOf;
private parseExpectedToken;
private parseExpected;
private parseOptionalToken;
private parseOptional;
private isEdgeOp;
private isIdentifier;
private isCompassPointKind;
private speculationHelper;
private lookAhead;
private tryParse;
}
export declare function isIdentifier(kind: SyntaxKind): boolean;
export declare function isIdentifierNode<T extends SyntaxNode>(node: SyntaxNode): node is Identifier;

@@ -34,18 +34,17 @@ import { SyntaxKind, TokenFlags, DiagnosticCategory, ScanError } from "./types";

setErrorCallback(cb: ErrorCallback | null): void;
private setTextPos(textPos);
private setTextPos;
scan(skipTrivia?: boolean): SyntaxKind;
private error(message, sub, category?);
private error(message, sub, errPos, length, category?);
private isWhiteSpaceSingleLine(ch);
private isAtMultiLineCommentEnd(pos);
private scanHashCommentTrivia(skip);
private scanSingleLineCommentTrivia(skip);
private scanMultiLineCommentTrivia(skip);
private scanHtml();
private scanString(allowEscapes?);
private scanNumber();
private getIdentifierToken(tokenValue);
private error;
private isWhiteSpaceSingleLine;
private isAtMultiLineCommentEnd;
private scanHashCommentTrivia;
private scanSingleLineCommentTrivia;
private scanMultiLineCommentTrivia;
private scanHtml;
private scanString;
private scanNumber;
private getIdentifierToken;
lookAhead<T extends SyntaxKind>(callback: () => T): T;
tryScan<T extends SyntaxKind>(callback: () => T): T;
private speculationHelper<T>(callback, isLookahead);
private speculationHelper;
}

@@ -52,0 +51,0 @@ export declare function isIdentifierStart(ch: number): boolean;

@@ -9,5 +9,5 @@ import * as lst from "vscode-languageserver-types";

ConsolidateDescendants = "DOT.consolidateDescendants",
RemoveSemicolons = "DOT.removeSemicolons",
RemoveSemicolons = "DOT.removeSemicolons"
}
export declare function getAvailableCommands(): string[];
export declare function executeCommand(doc: DocumentLike, sourceFile: SourceFile, cmd: ExecutableCommand): CommandApplication | undefined;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
const __1 = require("../");
const util_1 = require("./util");

@@ -59,6 +59,6 @@ const checker_1 = require("../checker");

if (clickedNode && !!clickedNode.parent) {
if (clickedNode.kind === _1.SyntaxKind.SemicolonToken) {
if (clickedNode.kind === __1.SyntaxKind.SemicolonToken) {
res.push(RemoveSemicolonsCommand.create());
}
if (_1.isIdentifierNode(clickedNode)) {
if (__1.isIdentifierNode(clickedNode)) {
clickedNode = clickedNode.parent;

@@ -79,3 +79,3 @@ }

let hasVisitedNodeModifier = false;
_1.forEachChild(graphParent, statement => {
__1.forEachChild(graphParent, statement => {
if (statement === clickedEdgeStatement) {

@@ -203,3 +203,3 @@ hasVisitedStatement = true;

let hasError = false;
_1.forEachChild(node, child => {
__1.forEachChild(node, child => {
if (hasNodeError(child)) {

@@ -206,0 +206,0 @@ hasError = true;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const lst = require("vscode-languageserver-types");
const _1 = require("../../");
const __1 = require("../../");
function createChangeToEdit(start, end, changeTo) {

@@ -11,21 +11,21 @@ return lst.TextEdit.replace(lst.Range.create(start, end), changeTo);

function getEdgeStr(op) {
return op === _1.SyntaxKind.DirectedEdgeOp ? "->" : "--";
return op === __1.SyntaxKind.DirectedEdgeOp ? "->" : "--";
}
exports.getEdgeStr = getEdgeStr;
function getGraphKeywordStr(g) {
return g === _1.SyntaxKind.DigraphKeyword ? "digraph" : "graph";
return g === __1.SyntaxKind.DigraphKeyword ? "digraph" : "graph";
}
exports.getGraphKeywordStr = getGraphKeywordStr;
function getOppositeKind(g) {
return g === _1.SyntaxKind.DigraphKeyword ? _1.SyntaxKind.GraphKeyword : _1.SyntaxKind.DigraphKeyword;
return g === __1.SyntaxKind.DigraphKeyword ? __1.SyntaxKind.GraphKeyword : __1.SyntaxKind.DigraphKeyword;
}
exports.getOppositeKind = getOppositeKind;
function getOppositeEdgeOp(g) {
return g === _1.SyntaxKind.DirectedEdgeOp ? _1.SyntaxKind.UndirectedEdgeOp : _1.SyntaxKind.DirectedEdgeOp;
return g === __1.SyntaxKind.DirectedEdgeOp ? __1.SyntaxKind.UndirectedEdgeOp : __1.SyntaxKind.DirectedEdgeOp;
}
exports.getOppositeEdgeOp = getOppositeEdgeOp;
function getAllowedOp(g) {
return g === _1.SyntaxKind.DigraphKeyword ? _1.SyntaxKind.DirectedEdgeOp : _1.SyntaxKind.UndirectedEdgeOp;
return g === __1.SyntaxKind.DigraphKeyword ? __1.SyntaxKind.DirectedEdgeOp : __1.SyntaxKind.UndirectedEdgeOp;
}
exports.getAllowedOp = getAllowedOp;
//# sourceMappingURL=common.js.map

@@ -7,3 +7,3 @@ "use strict";

const util_1 = require("./util");
const _1 = require("../");
const __1 = require("../");
function getCompletions(doc, sourceFile, position) {

@@ -23,3 +23,3 @@ const symbols = sourceFile.symbols;

return [];
if (_1.isIdentifierNode(prevNode)) {
if (__1.isIdentifierNode(prevNode)) {
const p = prevNode.parent;

@@ -26,0 +26,0 @@ if (p && p.kind === types_1.SyntaxKind.NodeId) {

@@ -5,3 +5,3 @@ "use strict";

const checker_1 = require("../checker");
const _1 = require("../");
const __1 = require("../");
const util_1 = require("./util");

@@ -28,3 +28,3 @@ function hover(doc, sourceFile, position) {

function getHoverContents(n) {
if (_1.isIdentifierNode(n)) {
if (__1.isIdentifierNode(n)) {
const parent = n.parent;

@@ -31,0 +31,0 @@ if (parent) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
const __1 = require("../");
const checker_1 = require("../checker");

@@ -16,3 +16,3 @@ const util_1 = require("./util");

return [];
if (_1.isIdentifierNode(node)) {
if (__1.isIdentifierNode(node)) {
const nodeSymbol = node.symbol;

@@ -57,3 +57,3 @@ if (!nodeSymbol)

return undefined;
if (_1.isIdentifierNode(node)) {
if (__1.isIdentifierNode(node)) {
const nodeSymbol = node.symbol;

@@ -60,0 +60,0 @@ if (!nodeSymbol)

@@ -6,3 +6,3 @@ "use strict";

const checker_1 = require("../checker");
const _1 = require("../");
const __1 = require("../");
const util_1 = require("./util");

@@ -22,3 +22,3 @@ function renameSymbol(doc, sourceFile, position, newName) {

const parent = node.parent;
if (_1.isIdentifierNode(node) && isRenamableIdentifier(node) && !!parent && isRenameableNode(parent)) {
if (__1.isIdentifierNode(node) && isRenamableIdentifier(node) && !!parent && isRenameableNode(parent)) {
const nodeSymbol = node.symbol;

@@ -25,0 +25,0 @@ if (!nodeSymbol)

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
const __1 = require("../");
const binder_1 = require("../binder");

@@ -13,3 +13,3 @@ const hover_1 = require("./hover");

function parseDocument(doc) {
const parser = new _1.Parser();
const parser = new __1.Parser();
const content = typeof doc === "string" ? doc : doc.getText();

@@ -16,0 +16,0 @@ const sourceFile = parser.parse(content);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("../types");
const _1 = require("../");
const __1 = require("../");
function getStart(sourceFile, node) {

@@ -12,3 +12,3 @@ return getTokenPosOfNode(sourceFile, node);

return node.pos;
return _1.skipTrivia(sourceFile.content, node.pos);
return __1.skipTrivia(sourceFile.content, node.pos);
}

@@ -42,3 +42,3 @@ function nodeIsMissing(node) {

const ch = text.charCodeAt(0);
if (!_1.isIdentifierStart(ch) || text.includes(" "))
if (!__1.isIdentifierStart(ch) || text.includes(" "))
return quote(text);

@@ -45,0 +45,0 @@ return text;

export declare const enum ErrorSource {
Scan = 1,
Parse = 2,
Check = 4,
Check = 4
}

@@ -22,10 +22,10 @@ export declare type ErrorCode = ParseErrorCode | ScanErrorCode | CheckErrorCode;

TrailingData = 1,
FailedListParsing = 2,
FailedListParsing = 2
}
export declare const enum ScanError {
ExpectationFailed = 0,
Unterminated = 1,
Unterminated = 1
}
export declare const enum CheckError {
InvalidEdgeOperation = 0,
InvalidEdgeOperation = 0
}

@@ -43,3 +43,3 @@ export interface DiagnosticMessage {

Message = 3,
Suggestion = 4,
Suggestion = 4
}

@@ -219,3 +219,3 @@ export declare type ID = string;

CompassEnd = 27,
LastKeyword = 38,
LastKeyword = 38
}

@@ -242,3 +242,3 @@ export interface SyntaxNode extends TextRange {

ContainsErrors = 2,
Synthesized = 4,
Synthesized = 4
}

@@ -249,3 +249,3 @@ export declare const enum GraphContext {

Directed = 4,
Undirected = 8,
Undirected = 8
}

@@ -255,3 +255,3 @@ export declare const enum TokenFlags {

Unterminated = 2,
PrecedingLineBreak = 4,
PrecedingLineBreak = 4
}

@@ -382,3 +382,3 @@ export declare const enum CharacterCodes {

tab = 9,
verticalTab = 11,
verticalTab = 11
}

@@ -392,10 +392,3 @@ export declare type SymbolTable = Map<string, TypeSymbol>;

}
export declare type Diff<T extends string, U extends string> = ({
[P in T]: P;
} & {
[P in U]: never;
} & {
[x: string]: never;
})[T];
export declare type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export declare type StatementOf<T extends Statement["kind"]> = T extends SyntaxKind.SubGraphStatement ? SubGraphStatement : T extends SyntaxKind.AttributeStatement ? AttributeStatement : T extends SyntaxKind.EdgeStatement ? EdgeStatement : T extends SyntaxKind.IdEqualsIdStatement ? IdEqualsIdStatement : T extends SyntaxKind.NodeStatement ? NodeStatement : never;
{
"name": "dot-language-support",
"version": "1.1.0",
"version": "1.1.1",
"description": "Parser and language service for graphviz (dot) files",

@@ -36,3 +36,3 @@ "author": "Niklas Mollenhauer",

"ts-node": "^6.0.5",
"typescript": "^2.8.3",
"typescript": "^2.9.1",
"vscode-languageserver": "^4.1.3"

@@ -39,0 +39,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc