Skip to content

[question] Why bsl language is not supported? #3

Open

Description

@nixel2007

Hello! I've noticed that BSL language is excluded. Could you explain why? Does it use some feature that is not supported in libprisma? We could try to adjust the grammar to make it work with your lib.

Thanks in advance!

Activity

  1. exclued commented on Nov 1, 2023

    @exclued

    Seems it have something to do with unsupported UTF-16 characters in the language grammar.

    function sanitize(pattern) { // Unsupported: // UTF-16 ranges
    from generate.js

    Compare this with BSL definition in https://github.com/PrismJS/prism/blob/master/components/prism-bsl.js

  2. nixel2007 commented on Nov 1, 2023

    @nixel2007
    Author

    Thanks, I'll take a look. For most cases these utf-16 sequences can be simplified to [а-яё], which are in utf-8 range

  3. nixel2007 commented on Nov 1, 2023

    @nixel2007
    Author

    prism.js v1 does not merge any PRs these days. Will you approve a .patch file with patch to bsl grammar and additions to generate.js/github workflow to apply the patch it at place?

  4. nixel2007 commented on Nov 27, 2023

    @nixel2007
    Author

    Hello, team! I'm looking into the new way to include bsl language into libprisma introduced recently. I want to clarify what does UTF-16 ranges in sanitize mean? Do you not support /uXXXX sequences at all or some concrete range (\uD800+ for example)?
    If /uXXXX sequences are not supported at all, is there any way to add cyrillic letters into regex? will regular [а-яё] work?

    /cc @FrayxRulez

  5. nixel2007 commented on Jan 18, 2024

    @nixel2007
    Author

    Anyone? :)

  6. FrayxRulez commented on Sep 20, 2024

    @FrayxRulez
    Collaborator

    Hi @nixel2007 sorry for the delay.
    Please, check Boost.Regex specifications in regards of UTF-16 support, as there are limitations in different areas (we use string and not wstring, and Boost regex syntax is slightly different and more limited than JS one).
    It's important that this works on all platforms, UNIX and Windows have different behaviors when dealing with strings.
    You can probably test this by generating a new grammars.dat file with only bsl enabled (you'll have to edit the generation script) and try to load it using the library. You'll see that Boost will crash right away while trying to interpret the patterns.

  7. nixel2007 commented on Sep 20, 2024

    @nixel2007
    Author

    Hi, @FrayxRulez !

    Thanks for your input, it's clear. I'll take a look.

  8. bapho-bush commented on Sep 22, 2024

    @bapho-bush

    we use string and not wstring, and Boost regex syntax is slightly different and more limited than JS one

    Could you please describe reasons why don't you use std::wstring and boost::wregex?

  9. mm8191 commented on Sep 25, 2024

    @mm8191

    دقیقا یادم نیس پیام مال چی بوده ولی توکن و دارایی من گم شده باید چکارکنم کی مسئول است عایا باید ب پاول دولف پیام بدم

  10. mm8191 commented on Sep 25, 2024

    @mm8191
  11. nixel2007 commented on Nov 19, 2026

    @nixel2007
    Author

    Hello folks! It took a while, but I made the changes to support BSL language in libprisma. Please take a look: #63

    @FrayxRulez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions