开发者

How to specify unicode characters in patterns for fslex

What is the correct way to specify Unicode characters in pattern for FSharp Lexer. Following code is not compiled with th开发者_如何学Goe FsLex.exe utility:

let lexeme lexbuf = LexBuffer<char>.LexemeString lexbuf
...
rule tokenize = parse   

| ['a'-'z' 'A'-'Z'] { TOKEN1 }  
| [\u0100\u0101]    { TOKEN2 } 
| [\u0102-\u01FF]   { TOKEN3 }  
...
| [eof]             { EOF }

What I'm doing wrong?

P.S: I'm using fslex.exe with --unicode option

Thanks, Vitaliy


I think you have to put the unicode characters in single quotes, just like in normal F# code.

At least that seems to work for a small example that I tested.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜