ParserCommon.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. // Common definitions used outside parser so that we don't have to include the whole Parser.h.
  6. #pragma once
  7. namespace Js
  8. {
  9. typedef int32 ByteCodeLabel; // Size of this match the offset size in layouts
  10. typedef uint32 RegSlot;
  11. typedef uint8 RegSlot_OneByte;
  12. typedef int8 RegSlot_OneSByte;
  13. typedef int16 RegSlot_TwoSByte;
  14. typedef uint16 RegSlot_TwoByte;
  15. }
  16. enum ErrorTypeEnum
  17. {
  18. kjstError,
  19. kjstEvalError,
  20. kjstRangeError,
  21. kjstReferenceError,
  22. kjstSyntaxError,
  23. kjstTypeError,
  24. kjstURIError,
  25. kjstWebAssemblyCompileError,
  26. kjstWebAssemblyRuntimeError,
  27. kjstWebAssemblyLinkError,
  28. kjstCustomError,
  29. #ifdef ENABLE_PROJECTION
  30. kjstWinRTError,
  31. #endif
  32. };
  33. struct ParseNode;
  34. typedef ParseNode *ParseNodePtr;
  35. struct Ident;
  36. typedef Ident *IdentPtr;
  37. struct ModuleImportOrExportEntry
  38. {
  39. IdentPtr moduleRequest;
  40. IdentPtr importName;
  41. IdentPtr localName;
  42. IdentPtr exportName;
  43. };
  44. typedef SList<ModuleImportOrExportEntry, ArenaAllocator> ModuleImportOrExportEntryList;
  45. typedef SList<IdentPtr, ArenaAllocator> IdentPtrList;
  46. //
  47. // Below was moved from scrutil.h to share with chakradiag.
  48. //
  49. #define HR(sc) ((HRESULT)(sc))