Coder Social home page Coder Social logo

Comments (8)

ethercrow avatar ethercrow commented on May 7, 2024 2

I'll leave this here in case someone will have the same question.

 +#if MIN_TOOL_VERSION_alex(3,2,0)
 +      (AlexLastAcc k input'' len, _, lookahead) -> (AlexToken input'' len (alex_actions ! k), lookahead)
 +#else
        (AlexLastAcc k input'' len, _, lookahead) -> (AlexToken input'' len k, lookahead)
 +#endif

from alex.

ethercrow avatar ethercrow commented on May 7, 2024

The relevant line: https://github.com/yi-editor/yi/blob/master/yi-language/src/Yi/Lexer/common.hsinc#L39

Here act is either an action or an index for alex_actions.

from alex.

simonmar avatar simonmar commented on May 7, 2024

Can you do something like this in your .cabal file?

flag alex32
  default: True

if flag(alex32)
  build-depends: alex >= 3.2
  ghc-options: -DALEX_3_2
else
  build-depends: alex < 3.2

from alex.

ethercrow avatar ethercrow commented on May 7, 2024

I can but this would put the burden of knowing their alex version and supplying this flag on users, who most likely don't even know what alex is.

I'll do that if there's no other option.

@snoyberg @juhp Does stack by any chance expose alex version in some #define?

from alex.

simonmar avatar simonmar commented on May 7, 2024

I can but this would put the burden of knowing their alex version and supplying this flag on users, who most likely don't even know what alex is.

No - Cabal infers the value of flags automatically, users wouldn't need to do anything.

from alex.

snoyberg avatar snoyberg commented on May 7, 2024

I'm not sure this will work; build-depends doesn't play nicely with executable-only packages.

from alex.

simonmar avatar simonmar commented on May 7, 2024

If it doesn't, then you could use another package as a proxy. (a gross hack, but it would probably work)

from alex.

ethercrow avatar ethercrow commented on May 7, 2024

@qnikst proposed to use TOOL_VERSION_alex defined by Cabal

from alex.

Related Issues (20)

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.