Coder Social home page Coder Social logo

fsattoparsec's Introduction

fsattoparsec's People

Contributors

pocketberserker avatar devshorts avatar

Stargazers

Nicholas avatar orlando avatar Oskar Gewalli avatar Gustavo Leon avatar Gregor Beyerle avatar bleis-tift avatar Zaid Ajaj avatar Roman Melnikov avatar Henrik Feldt avatar DiGiTAL_CuRSe avatar RG avatar Andrew Jones avatar Mark Laws avatar Bent Rasmussen avatar MIYAZAKI Shohei avatar  avatar Nobuhisa Koizumi avatar  avatar Ryan Riley avatar Brad Pillow avatar Mark Watts avatar Jon Schoning avatar Andrea avatar Brad Jones avatar César López-Natarén avatar Claudia Doppioslash avatar Will Smith avatar Mauricio Scheffer avatar

Watchers

Andrea avatar Brad Jones avatar Mauricio Scheffer avatar James Cloos avatar

fsattoparsec's Issues

Progress?

Hi there,

I would be great to have a high-performance binary parser in F#. Are you considering maintaining and moving forward with this project?

パースに失敗する

実装

let ba xs = Array.map byte xs
let ``-`` = bytes (ba [| '-' |])

let boundary b =
  let parser = bytes b
  (``-`` >>. ``-`` >>. parser) <|> parser
  |>> ignore

テスト

  [<TestCase("abc", "--abc", true)>]
  [<TestCase("abc", "abc", true)>]
  [<TestCase("abc", "--", false)>]
  [<TestCase("abc", "abC", false)>]
  [<TestCase("abc", "bac", false)>]
  [<TestCase("abc", "---abc", false)>]
  [<TestCase("--abc", "----abc", true)>]
  [<TestCase("--abc", "--abc", true)>]
  [<TestCase("--abc", "---abc", false)>]
  let boundaryparseできる(b: string, input: string, expected: bool) =
    let actual =
      match parse (boundary (ba b)) (ba input) with
      | Done _ -> true
      | _ -> false
    actual |> should equal expected

"--abc" "--abc"のパターンが失敗する。
実装で選択の順番を入れ替えるとparser <|> (``-`` >>. ``-`` >>. parser) 成功する。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.