From ede1b458f11ff8a28d13977c11708bd964944bd0 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 20 Apr 2024 12:05:08 +0800 Subject: [PATCH] some optimize --- include/pocketpy/compiler.h | 2 +- include/pocketpy/random.h | 2 +- include/pocketpy/repl.h | 1 - src/compiler.cpp | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pocketpy/compiler.h b/include/pocketpy/compiler.h index 4cbbba6b..3087bcc7 100644 --- a/include/pocketpy/compiler.h +++ b/include/pocketpy/compiler.h @@ -19,7 +19,7 @@ struct PrattRule{ class Compiler { PK_ALWAYS_PASS_BY_POINTER(Compiler) - inline static PrattRule rules[kTokenCount]; + static PrattRule rules[kTokenCount]; Lexer lexer; stack_no_copy contexts; diff --git a/include/pocketpy/random.h b/include/pocketpy/random.h index 9824705d..4d16f39c 100644 --- a/include/pocketpy/random.h +++ b/include/pocketpy/random.h @@ -1,6 +1,6 @@ #pragma once -#include "cffi.h" +#include "bindings.h" namespace pkpy{ diff --git a/include/pocketpy/repl.h b/include/pocketpy/repl.h index 4c02083a..5118d013 100644 --- a/include/pocketpy/repl.h +++ b/include/pocketpy/repl.h @@ -1,6 +1,5 @@ #pragma once -#include "compiler.h" #include "vm.h" namespace pkpy{ diff --git a/src/compiler.cpp b/src/compiler.cpp index 9cd5e5d8..ee9a4d1c 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -1,6 +1,7 @@ #include "pocketpy/compiler.h" namespace pkpy{ + PrattRule Compiler::rules[kTokenCount]; NameScope Compiler::name_scope() const { auto s = contexts.size()>1 ? NAME_LOCAL : NAME_GLOBAL;