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

gravlax

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gravlax - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

lib/ast-printer.d.ts

2

lib/ast.d.ts

@@ -16,3 +16,3 @@ import { Token } from './token.js';

kind: "literal";
value: null | number | string;
value: boolean | null | number | string;
}

@@ -19,0 +19,0 @@ interface Unary {

@@ -0,1 +1,4 @@

import { Token } from './token.js';
import './token-type.js';
declare function add(a: number, b: number): number;

@@ -5,4 +8,5 @@ declare function runFile(path: string): Promise<void>;

declare function error(line: number, message: string): void;
declare function errorOnToken(token: Token, message: string): void;
declare function main(): Promise<void>;
export { add, error, main, runFile, runPrompt };
export { add, error, errorOnToken, main, runFile, runPrompt };
import * as fs from "node:fs/promises";
import { createInterface } from "node:readline";
import { visitExpr } from "./ast.js";
import { astPrinter } from "./ast-printer.js";
import { parse } from "./parser.js";
import { Scanner } from "./scanner.js";

@@ -23,2 +26,9 @@ function add(a, b) {

}
function errorOnToken(token, message) {
if (token.type === "eof") {
report(token.line, " at end", message);
} else {
report(token.line, ` at '${token.lexeme}'`, message);
}
}
function report(line, where, message) {

@@ -30,3 +40,7 @@ console.error(`[line ${line}] Error${where}: ${message}`);

const tokens = scanner.scanTokens();
console.log(tokens);
const expr = parse(tokens);
if (hadError || !expr) {
return;
}
console.log(visitExpr(expr, astPrinter));
}

@@ -50,2 +64,3 @@ async function main() {

error,
errorOnToken,
main,

@@ -52,0 +67,0 @@ runFile,

{
"name": "gravlax",
"version": "0.1.0",
"version": "0.2.0",
"description": "A Lox interpreter with tasty TypeScript seasoning",

@@ -57,2 +57,3 @@ "repository": {

"eslint-plugin-n": "^16.6.1",
"eslint-plugin-no-autofix": "^1.2.3",
"eslint-plugin-no-only-tests": "^3.1.0",

@@ -59,0 +60,0 @@ "eslint-plugin-perfectionist": "^2.5.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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