2016-11-15 1 views
1

그래서 FParsec 샘플에서 다음 코드를 실행하고 있지만 실행하고 싶지 않습니다.FParsec 예제가 실행되지 않는 이유는 무엇입니까?

namespace Test 
open FParsec.CharParsers 
module Stuff = 
    let main = run pfloat "1.25E3" 
    let str s = pstring s 
    let floatBetweenBrackets = str "[" >>. pfloat .>> str "]" 

문제는 마지막 줄입니다 -이 오류 얻을 :

Error 1 Expecting a type supporting the operator '>>.' but given a function type. You may be missing an argument to a function. C:\Users\...\Documents\Visual Studio 2013\Projects\Solution2\ConsoleApplication1\load.fs 6 42 Formatting 

코드는 여기에서있다 :

http://www.quanttec.com/fparsec/tutorial.html#parsing-a-float-between-brackets 

이 중요한 경우, 난 F 번호의 버전을 달리기 :

Microsoft (R) F# Interactive version 12.0.30110.0 
+2

'(>>. >>)는'FParsec.Primitives' 모듈에 정의되어 있다고 생각합니다. 따라서 컴파일 할 코드를 열어야합니다. – kvb

답변

4

>>.FParsec.Primitives에 정의되어 있으므로 열어야합니다. 양자 택일로, 당신은 당신이보고있는 오류가 무엇인지 왜

Opening the FParsec namespace also automatically opens the Primitives, CharParsers and Error modules.

This answersince 설명, FParsec을 열 수 있습니다.

관련 문제