@@ -97,6 +97,54 @@ const decoratorsLegacy = useOptions(
9797 }
9898 },
9999)
100+
101+ const pipelineOperator = useOptions (
102+ (opt : ParserOptions ) =>
103+ opt .plugins ?.some ((n ) => Array .isArray (n ) && n [0 ] === ' pipelineOperator' ),
104+ (value , opt ) => {
105+ if (! Array .isArray (opt .plugins )) opt .plugins = []
106+ if (value ) {
107+ opt .plugins .push ([
108+ ' pipelineOperator' ,
109+ { proposal: ' hack' , topicToken: ' #' },
110+ ])
111+ } else {
112+ opt .plugins = opt .plugins .filter (
113+ (n ) => ! Array .isArray (n ) || n [0 ] !== ' pipelineOperator' ,
114+ )
115+ }
116+ },
117+ )
118+
119+ function findPipelineOperator(optPlugins : ParserOptions [' plugins' ]) {
120+ return optPlugins ?.find (
121+ (n ) => Array .isArray (n ) && n [0 ] === ' pipelineOperator' ,
122+ )
123+ }
124+
125+ const pipelineOperatorProposal = useOptions (
126+ (opt : ParserOptions ) => findPipelineOperator (opt .plugins )?.[1 ].proposal ,
127+ (value , opt ) => {
128+ const pipelineOperator = findPipelineOperator (opt .plugins )
129+ if (! pipelineOperator ) return
130+ if (value === ' fsharp' ) {
131+ pipelineOperator [1 ].proposal = value
132+ delete pipelineOperator [1 ].topicToken
133+ } else if (value === ' hack' ) {
134+ pipelineOperator [1 ].proposal = value
135+ pipelineOperator [1 ].topicToken = ' #'
136+ }
137+ },
138+ )
139+ const pipelineOperatorTopicToken = useOptions (
140+ (opt : ParserOptions ) => findPipelineOperator (opt .plugins )?.[1 ].topicToken ,
141+ (value , opt ) => {
142+ const pipelineOperator = findPipelineOperator (opt .plugins )
143+ if (! pipelineOperator ) return
144+ pipelineOperator [1 ].topicToken = value
145+ },
146+ )
147+
100148const decoratorAutoAccessors = usePlugin (' decoratorAutoAccessors' , [decorators ])
101149const decimal = usePlugin (' decimal' )
102150const deferredImportEvaluation = usePlugin (' deferredImportEvaluation' )
@@ -110,7 +158,6 @@ const importReflection = usePlugin('importReflection')
110158const moduleBlocks = usePlugin (' moduleBlocks' )
111159const optionalChainingAssign = usePlugin (' optionalChainingAssign' )
112160const partialApplication = usePlugin (' partialApplication' )
113- const pipelineOperator = usePlugin (' pipelineOperator' )
114161const recordAndTuple = usePlugin (' recordAndTuple' )
115162const sourcePhaseImports = usePlugin (' sourcePhaseImports' )
116163const throwExpressions = usePlugin (' throwExpressions' )
@@ -271,6 +318,28 @@ const throwExpressions = usePlugin('throwExpressions')
271318 <span >pipelineOperator</span >
272319 </label >
273320
321+ <label ml6 >
322+ <span >proposal</span >
323+ <select v-model =" pipelineOperatorProposal" :disabled =" !pipelineOperator" >
324+ <option value =" hack" >hack</option >
325+ <option value =" fsharp" >fsharp</option >
326+ </select >
327+ </label >
328+
329+ <label ml6 >
330+ <span >topicToken</span >
331+ <select
332+ v-model =" pipelineOperatorTopicToken"
333+ :disabled =" !pipelineOperator || pipelineOperatorProposal !== 'hack'"
334+ >
335+ <option value =" %" >%</option >
336+ <option value =" #" >#</option >
337+ <option value =" ^" >^</option >
338+ <option value =" @@" >@@</option >
339+ <option value =" ^^" >^^</option >
340+ </select >
341+ </label >
342+
274343 <label >
275344 <!-- Stage 2 -->
276345 <input v-model =" functionSent" type =" checkbox" switch />
0 commit comments