Skip to content

Commit

Permalink
Merge pull request #767 from Quramy/upgrade_prettier
Browse files Browse the repository at this point in the history
upgrade prettier
  • Loading branch information
Quramy committed Mar 4, 2024
2 parents 5288b00 + dae724f commit 43b09b9
Show file tree
Hide file tree
Showing 13 changed files with 170 additions and 180 deletions.
199 changes: 90 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -19,8 +19,8 @@
"dependency-cruiser": "16.2.2",
"husky": "9.0.11",
"jest": "29.7.0",
"prettier": "2.8.8",
"pretty-quick": "3.3.1",
"prettier": "3.2.5",
"pretty-quick": "4.0.0",
"rimraf": "5.0.5",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/cli/error-reporter.ts
Expand Up @@ -19,7 +19,10 @@ export type ErrorContent = {
};

export class ErrorReporter {
constructor(private readonly _currentDirectory: string, private readonly _output: (msg: string) => void = () => {}) {}
constructor(
private readonly _currentDirectory: string,
private readonly _output: (msg: string) => void = () => {},
) {}

outputError(error: ErrorContent) {
if (!error.occurence?.loc) {
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/cli/parser.ts
Expand Up @@ -50,12 +50,12 @@ type ParseOptions = {
type Dispatch<T extends CommandLineOptionEntry> = T extends BooleanOptionEntry
? boolean
: T extends StringOptionEntry
? string
: T extends OptionalStringOptionEntry
? string | undefined
: T extends IntegerOptionEntry
? number
: never;
? string
: T extends OptionalStringOptionEntry
? string | undefined
: T extends IntegerOptionEntry
? number
: never;

type OptionsResult<T extends OptionsHolder> = {
[P in keyof T["options"]]: Dispatch<T["options"][P]>;
Expand Down
15 changes: 9 additions & 6 deletions packages/core/src/compiler/assets/modules/float.ts
Expand Up @@ -55,9 +55,12 @@ export const getFloatValueInstr = wat.instructions`
`;

export const reduceInstructions = (instructions: readonly InstructionNode[]) =>
instructions.reduce((acc, node) => {
if (!isCalling(node, "__float_get__")) return [...acc, node];
const last = acc.slice(-1);
if (!last.length || !isCalling(last[0], "__float_new__")) return [...acc, node];
return acc.slice(0, acc.length - 1);
}, [] as readonly InstructionNode[]);
instructions.reduce(
(acc, node) => {
if (!isCalling(node, "__float_get__")) return [...acc, node];
const last = acc.slice(-1);
if (!last.length || !isCalling(last[0], "__float_new__")) return [...acc, node];
return acc.slice(0, acc.length - 1);
},
[] as readonly InstructionNode[],
);
Expand Up @@ -3,7 +3,7 @@ import { isMatch } from "./pattern-match";
import { EvaluationValue } from "../types";
import { createRootEnvironment } from "../environment";

const id = (name: string) => ({ kind: "Identifier", name } as const);
const id = (name: string) => ({ kind: "Identifier", name }) as const;

describe(isMatch, () => {
const getEnv = (input: string, value: EvaluationValue) =>
Expand Down

0 comments on commit 43b09b9

Please sign in to comment.