ParserCommon.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. class ParseNode;
  34. class ParseNodeFnc;
  35. typedef ParseNode *ParseNodePtr;
  36. struct Ident;
  37. typedef Ident *IdentPtr;
  38. struct ModuleImportOrExportEntry
  39. {
  40. IdentPtr moduleRequest;
  41. IdentPtr importName;
  42. IdentPtr localName;
  43. IdentPtr exportName;
  44. };
  45. typedef SList<ModuleImportOrExportEntry, ArenaAllocator> ModuleImportOrExportEntryList;
  46. typedef SList<IdentPtr, ArenaAllocator> IdentPtrList;
  47. typedef JsUtil::BaseHashSet<IdentPtr, ArenaAllocator, PowerOf2SizePolicy> IdentPtrSet;
  48. //
  49. // Below was moved from scrutil.h to share with chakradiag.
  50. //
  51. #define HR(sc) ((HRESULT)(sc))