Skip to content

Commit

Permalink
chore: remove unused locals (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Aug 2, 2024
1 parent c4fe6f7 commit cb1e3d4
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 30 deletions.
2 changes: 0 additions & 2 deletions src/implementation/c/compilation.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as assert from 'assert';
import { Buffer } from 'buffer';
import * as frontend from 'llparse-frontend';

import {
CONTAINER_KEY, STATE_ERROR,
ARG_STATE, ARG_POS, ARG_ENDPOS,
VAR_MATCH,
STATE_PREFIX, LABEL_PREFIX, BLOB_PREFIX,
SEQUENCE_COMPLETE, SEQUENCE_MISMATCH, SEQUENCE_PAUSE,
} from './constants';
import { Code } from './code';
import { Node } from './node';
Expand Down
2 changes: 0 additions & 2 deletions src/implementation/c/helpers/match-sequence.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as assert from 'assert';
import { Buffer } from 'buffer';
import * as frontend from 'llparse-frontend';

import {
Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/consume.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { Node } from './base';

export class Consume extends Node<frontend.node.Consume> {
Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/empty.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { Node } from './base';

export class Empty extends Node<frontend.node.Empty> {
Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/error.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { STATE_ERROR } from '../constants';
import { Node } from './base';

Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/invoke.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { Node } from './base';

export class Invoke extends Node<frontend.node.Invoke> {
Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/pause.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { STATE_ERROR } from '../constants';
import { Error as ErrorNode } from './error';

Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/sequence.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import {
SEQUENCE_COMPLETE, SEQUENCE_MISMATCH, SEQUENCE_PAUSE,
} from '../constants';
Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/single.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { Node } from './base';

export class Single extends Node<frontend.node.Single> {
Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/span-end.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { STATE_ERROR } from '../constants';
import { Node } from './base';

Expand Down
1 change: 0 additions & 1 deletion src/implementation/c/node/span-start.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { Node } from './base';

export class SpanStart extends Node<frontend.node.SpanStart> {
Expand Down
3 changes: 1 addition & 2 deletions src/implementation/c/node/table-lookup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as assert from 'assert';
import * as frontend from 'llparse-frontend';

import { Compilation } from '../compilation';
import { Node } from './base';

const MAX_CHAR = 0xff;
Expand Down Expand Up @@ -40,7 +39,7 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
const current = transform.build(ctx, `*${ctx.posArg()}`);
out.push(`switch (${table.name}[(uint8_t) ${current}]) {`);

for (const [ index, edge ] of this.ref.edges.entries()) {
for (const [ index ] of this.ref.edges.entries()) {
out.push(` case ${index + 1}: {`);

const tmp: string[] = [];
Expand Down
4 changes: 1 addition & 3 deletions test/code-test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as assert from 'assert';

import { LLParse } from '../src/api';

import { build, NUM_SELECT, printMatch, printOff } from './fixtures';
import { build, NUM_SELECT, printOff } from './fixtures';

describe('llparse/code', () => {
let p: LLParse;
Expand Down
4 changes: 1 addition & 3 deletions test/consume-test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as assert from 'assert';

import { LLParse } from '../src/api';

import { build, NUM_SELECT, printMatch, printOff } from './fixtures';
import { build, NUM_SELECT, printOff } from './fixtures';

describe('llparse/consume', () => {
let p: LLParse;
Expand Down
4 changes: 1 addition & 3 deletions test/resumption-test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as assert from 'assert';

import { LLParse } from '../src/api';

import { build, ERROR_PAUSE, printMatch, printOff } from './fixtures';
import { build, ERROR_PAUSE, printOff } from './fixtures';

describe('llparse/resumption', () => {
let p: LLParse;
Expand Down
4 changes: 1 addition & 3 deletions test/span-test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as assert from 'assert';

import { LLParse } from '../src/api';

import { build, printMatch, printOff } from './fixtures';
import { build } from './fixtures';

describe('llparse/spans', () => {
let p: LLParse;
Expand Down
2 changes: 0 additions & 2 deletions test/transform-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as assert from 'assert';

import { LLParse } from '../src/api';

import { build, printMatch, printOff } from './fixtures';
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"outDir": "./lib",
"declaration": true,
"pretty": true,
"sourceMap": true
"sourceMap": true,
"noUnusedLocals": true
},
"include": [
"src/**/*.ts"
Expand Down

0 comments on commit cb1e3d4

Please sign in to comment.