Function.h 574 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2023, Dan Klishch <danilklishch@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/HashMap.h>
  8. #include <AK/RefCounted.h>
  9. #include <AK/RefPtr.h>
  10. #include <AK/StringView.h>
  11. #include "Forward.h"
  12. namespace JSSpecCompiler {
  13. class ExecutionContext {
  14. public:
  15. HashMap<StringView, FunctionPointerRef> m_functions;
  16. };
  17. class Function : public RefCounted<Function> {
  18. public:
  19. Function(ExecutionContext* context, StringView name, Tree ast);
  20. ExecutionContext* m_context;
  21. StringView m_name;
  22. Tree m_ast;
  23. };
  24. }