Coder Social home page Coder Social logo

rust-nom-unicode's Introduction

nom-unicode

Build Status Latest Version Rustc Version 1.31+

Unicode primitive parsing extensions for nom.

Table of Contents

Getting Started

Add nom-unicode to your Cargo.toml:

[dependencies]
nom-unicode = "^0.2"

And get started using nom-unicode:

extern crate nom;
extern crate nom_unicode;

fn alpha0(i: &str) -> nom::IResult<&str, &str> {
    nom_unicode::complete::alpha0(i)
}

fn main() {
    println!("{:?}", alpha0("hello"));
    println!("{:?}", alpha0("erfüllen"));
    println!("{:?}", alpha0("안녕 잘 지내?"));
}

Minimum Standard Required Version

The minimum, standard, required version for nom-unicode will be the same as nom. As of nom-6, it is currently 1.43.0.

License

Nom-Unicode is dual licensed under the Apache 2.0 license as well as the MIT license. See the LICENCE-MIT and the LICENCE-APACHE files for the licenses.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in nom-unicode by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

rust-nom-unicode's People

Contributors

alexhuszagh avatar leifhelm avatar nagua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rust-nom-unicode's Issues

Nom 7 Compatibility?

Does this still work for Nom 7, which was recently released.

  1. Check for compatibility.
  2. Update Cargo.toml for use with Nom 7.0.

Match on only some 16bit unicode characters

Hi I was hoping to ask some advice for using you library
I have to pass a uri string for the zinc file format
https://www.project-haystack.org/doc/Zinc
The BNF grammar for the uri is

:= "" <uriChar>* ""
:= |
:= any 16-bit Unicode char >= 0x20 (except str/uri quote)
:= ":" | "/" | "?" | "#" | "[" | "]" | "@" | "`" | "\" | "&" | "=" | ";" |
:= "\u"

Now I can detect the additional uriEscChar values that the string can contain
but how can I keep to unicode characters >= 0x20 (except str/uri quote)

Having trouble knowing where to start implementing that function.

Thanks

Add character class combinators

I'm hoping to write a parser for a programming language that has exceptional unicode support. However, the language's productions for identifiers requires that they be an alternating list of unicode character categories. Specifically, the productions require me to determine if the categories are in the categories Ll, Lu, Lt, Lm, Lo, or Nl, for the first character, and Mn, Mc, Nd, and Pc, for all other characters. (The standard uses ISO/IEC 10646 categories, so it describes these as letter_uppercase, letter_lowercase, letter_titlecase, letter_modifier, letter_other, number_letter, mark_non_spacing, mark_spacing_combining, number_decimal, and punctuation_connector.) I am unsure if the existing combinators will allow me to fully meet the requirements of the productions, as the documentation doesn't specify included general categories for each combinator. Would it be possible for a combinator to retrieve characters of a given general category to be added? Or amI missing something?

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.