ParserCommon.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. kjstCustomError,
  26. #ifdef ENABLE_PROJECTION
  27. kjstWinRTError,
  28. #endif
  29. };
  30. struct ParseNode;
  31. typedef ParseNode *ParseNodePtr;
  32. //
  33. // Below was moved from scrutil.h to share with chakradiag.
  34. //
  35. #define HR(sc) ((HRESULT)(sc))
  36. #define MAKE_HR(vbserr) (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_CONTROL, vbserr))