File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,10 @@ class Context {
255255 // / also using Flow syntax.
256256 bool parseFlowMatch_{false };
257257
258+ // / If true, allow parsing Flow record declarations and expressions
259+ // / when also using Flow syntax.
260+ bool parseFlowRecords_{false };
261+
258262 // / Whether to parse Flow type syntax.
259263 ParseFlowSetting parseFlow_{ParseFlowSetting::NONE};
260264
@@ -452,6 +456,13 @@ class Context {
452456 return parseFlowMatch_;
453457 }
454458
459+ void setParseFlowRecords (bool parseFlowRecords) {
460+ parseFlowRecords_ = parseFlowRecords;
461+ }
462+ bool getParseFlowRecords () const {
463+ return parseFlowRecords_;
464+ }
465+
455466 void setParseTS (bool parseTS) {
456467 parseTS_ = parseTS;
457468 }
Original file line number Diff line number Diff line change @@ -515,6 +515,13 @@ static opt<bool> ParseFlowMatch(
515515 init(false ),
516516 Hidden,
517517 cat(CompilerCategory));
518+
519+ static opt<bool > ParseFlowRecords (
520+ " Xparse-flow-records" ,
521+ desc (" Parse Flow record declarations and expressions" ),
522+ init(false ),
523+ Hidden,
524+ cat(CompilerCategory));
518525#endif
519526
520527#if HERMES_PARSE_TS
@@ -1216,6 +1223,7 @@ std::shared_ptr<Context> createContext(
12161223 }
12171224 context->setParseFlowComponentSyntax (cl::ParseFlowComponentSyntax);
12181225 context->setParseFlowMatch (cl::ParseFlowMatch);
1226+ context->setParseFlowRecords (cl::ParseFlowRecords);
12191227#endif
12201228
12211229#if HERMES_PARSE_TS
You can’t perform that action at this time.
0 commit comments