ParseFlags.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #pragma once
  6. // Parse flags
  7. enum
  8. {
  9. fscrNil = 0,
  10. fscrHtmlComments = 1 << 0, // throw away html style comments
  11. fscrReturnExpression = 1 << 1, // call should return the last expression
  12. fscrImplicitThis = 1 << 2, // 'this.' is optional (for Call)
  13. fscrImplicitParents = 1 << 3, // the parents of 'this' are implicit
  14. fscrMapQuote = 1 << 4, // map single quote to double quote
  15. fscrDynamicCode = 1 << 5, // The code is being generated dynamically (eval, new Function, etc.)
  16. fscrSyntaxColor = 1 << 6, // used by the scanner for syntax coloring
  17. fscrNoImplicitHandlers = 1 << 7, // same as Opt NoConnect at start of block
  18. // prevents the need to make a copy to strip off trailing html comments
  19. // - modifies the behavior of fscrHtmlComments
  20. fscrDoNotHandleTrailingHtmlComments = 1 << 8,
  21. #if DEBUG
  22. fscrEnforceJSON = 1 << 9, // used together with fscrReturnExpression
  23. // enforces JSON semantics in the parsing.
  24. #endif
  25. fscrEval = 1 << 10, // this expression has eval semantics (i.e., run in caller's context
  26. fscrEvalCode = 1 << 11, // this is an eval expression
  27. fscrGlobalCode = 1 << 12, // this is a global script
  28. fscrDeferFncParse = 1 << 13, // parser: defer creation of AST's for non-global code
  29. fscrDeferredFncExpression = 1 << 14, // the function decl node we deferred is an expression,
  30. // i.e., not a declaration statement
  31. fscrDeferredFnc = 1 << 15, // the function we are parsing is deferred
  32. fscrNoPreJit = 1 << 16, // ignore prejit global flag
  33. fscrAllowFunctionProxy = 1 << 17, // Allow creation of function proxies instead of function bodies
  34. fscrIsLibraryCode = 1 << 18, // Current code is engine library code written in Javascript
  35. fscrNoDeferParse = 1 << 19, // Do not defer parsing
  36. // Unused = 1 << 20,
  37. #ifdef IR_VIEWER
  38. fscrIrDumpEnable = 1 << 21, // Allow parseIR to generate an IR dump
  39. #endif /* IRVIEWER */
  40. // Throw a ReferenceError when the global 'this' is used (possibly in a lambda),
  41. // for debugger when broken in a lambda that doesn't capture 'this'
  42. fscrDebuggerErrorOnGlobalThis = 1 << 22,
  43. fscrDeferredClassMemberFnc = 1 << 23,
  44. fscrConsoleScopeEval = 1 << 24, // The eval string is console eval or debugEval, used to have top level
  45. // let/const in global scope instead of eval scope so that they can be preserved across console inputs
  46. fscrNoAsmJs = 1 << 25, // Disable generation of asm.js code
  47. fscrIsModuleCode = 1 << 26, // Current code should be parsed as a module body
  48. fscrAll = (1 << 27) - 1
  49. };