Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

fastparse

Writing Fast Parsers Fast in Scala

Subscribe to updates I use fastparse


Statistics on fastparse

Number of watchers on Github 611
Number of open issues 29
Average time to close an issue 19 days
Main language Scala
Average time to merge a PR 3 days
Open pull requests 27+
Closed pull requests 11+
Last commit over 2 years ago
Repo Created about 5 years ago
Repo Last Updated almost 2 years ago
Size 12 MB
Organization / Authorlihaoyi
Contributors15
Page Updated
Do you use fastparse? Leave a review!
View open issues (29)
View fastparse activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating fastparse for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

FastParse Build Status Join the chat at https://gitter.im/lihaoyi/Ammonite

This is where the code for the FastParse parsing library lives! If you want to use Fastparse, you probably will want to check out the documentation:

This readme contains some developer docs, if you intend on working on the fastparse repo, not just using it as a library.

Developer Docs

The core of FastParse lives in the fastparse/ folder. It is cross-built ScalaJVM/Scala.js codebase, with almost everything shared between the two platforms in the fastparse/shared/ and minor differences in fastparse/js/ and fastparse/jvm/.

The three subprojects scalaparse/, pythonparse/ and cssparse/ are FastParse parsers for those respective languages. These are both usable as standalone libraries, and also serve as extensive test-suites and use-cases for FastParse itself. Each of those projects clones & parses large quantities of code from Github as part of their own test suites. byteparse module has also two subprojects classparse and BMP parser. The first one is parser for .class files for java-bytecode.

perftests/ constains performance tests for main projects in the library including ScalaParse, PythonParse, CssParse, ClassParse and ByteParse. util/ contains some basic utilities that FastParse uses that aren't specific to parsers: bitsets, escaping, tries, etc.. readme/ contains the documentation site, which contains several live demos of FastParse parsers compiled to Scala.js. These all live in demo/.

Common Commands

  • sbt ~fastparseJVM/test runs the main testsuite. If you're hacking on FastParse, this is often where you want to go
  • You can run the other suites for fastparseJS, scalaparseJVM, etc. if you wish, but I typically don't and leave that to CI unless I'm actively working on the sub-project
  • You can use + to run it under different Scala versions, but again I usually don't bother
  • very test is the aggregate test-all command, and very publishSigned is publish-all. Other things (compile, etc.) can also be run prefixed with very
  • readme/run builds the documentation site, which can then be found at readme/target/scalatex/index.html

Contribution Guidelines

  • If you're not sure if something is a bug or not, ask on Gitter first =)
  • All code PRs should come with: a meaningful description, inline comments for important things, unit tests, and a green build
  • Non-trivial changes, including bug fixes, should appear in the changelog. Feel free to add your name and link to your github profile!
  • New features should be added to the relevant parts of the documentation
  • To a large extent, FastParse is designed so that you can extend it in your own code without needing to modify the core. If you want to add features, be prepared to argue why it should be built-in and not just part of your own code.
  • It's entirely possible your changes won't be merged, or will get ripped out later. This is also the case for my changes, as the Author!
  • Even a rejected/reverted PR is valuable! It helps explore the solution space, and know what works and what doesn't. For every line in the repo, at least three lines were tried, committed, and reverted/refactored, and more than 10 were tried without committing.
  • Feel free to send Proof-Of-Concept PRs that you don't intend to get merged.
  • No binary or source compatibility is guaranteed between any releases. FastParse is still in the 0.x.y phase of development, which means it's still under rapid development and things do change. On the other hand, upgrading is usually trivial, and I don't expect existing functionality to go away

License

The MIT License (MIT)

Copyright (c) 2014 Li Haoyi (haoyi.sg@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

fastparse open issues Ask a question     (View All Issues)
  • over 3 years StringIn("") fails
  • over 3 years Zero elements check in Iterator Parsing
  • over 3 years Add a new FastParse Javascript parser
  • almost 4 years Should flatMap intersperse whitespace when using WhitespaceApi ?
  • almost 4 years monadic Parsed
  • almost 4 years Enhance log() to display on Success the text (or a summarized version of it) that a rule processed.
  • about 4 years lookahead does not capture
  • about 4 years `pythonparseJVM:test` fails on master
  • about 4 years value | is not a member of String in Scala 2.10
  • about 4 years Write a cookbook of common patterns and techniques
  • about 4 years Documentation should contain section on "When to use `P(...)`"
  • over 4 years capture the whole parsed string along side with captured substrings.
  • over 4 years Include parsers for standard (Java) types
  • over 4 years Parse CharSequence rather than String
fastparse open pull requests (View All Pulls)
  • Enhance log() to display on Success the text (or a summarized version of it) that a rule processed.
  • Added a StringInIgnoreCase parser
  • Added cssparse module
  • Add a `to` method to the Api
  • changed https to http in documentation link
  • [WIP] Two new type-parameters for element type of input in the parser and representaion of the output
  • Experiment of hardcored vector perfomance **Not for merge**
  • Parser for .class bytecode files
  • Iterator parser
  • Added Parser.unapply(s: Repr): Option[T]
  • Strange usage of Pass in scalaparse
  • Added a clarification to the docs about trailing whitespace
  • Added fold method to Parsed ADT
  • Scala 2.12.0-RC2
  • Add ElemsIn intrinsic
  • be Scala 2.13 friendly
  • Parsing support of Vectors[_] or others sequences converted to Vector
  • Python 3.x parser
  • Rewrite the XML parser based on the scalac one
  • only ever needed in tests
  • Add support for trailing commas
  • update parsing results section ...
  • Python 3.x parser (improved)
  • More closely match scalac XML parser behavior
  • use openjdk7 instead of oraclejdk7
  • change the order of the type parameters of core.Parser…
  • add collect method
fastparse questions on Stackoverflow (View All Questions)
  • How to match exactly 'n' given characters with FastParse
  • SSIS : Flat File Source : FastParse property - Date column - error
  • How to turn on FastParse option in SSIS?
fastparse list of languages used
Other projects in Scala