Giter VIP home page Giter VIP logo

judge-gen's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

judge-gen's Issues

Fails to handle certain constructs using long-strings

Input for reproduction:

(comment

  (-> ``
      123456789
      ``
      length)
  # => 9

  (->
    ``
    123456789
    ``
    length)
  # => 9
  
  )

Both of these should result in the same length of 9. The first one results in 14.

Relevant code is:

(string "(_verify/is "
last-form " "

The resulting code for the first case ends up like:

(_verify/is (-> ``
      12345789
      ``
      length)
      9 "line-...")

This is a problem because for Janet to do the "removes leading whitespace" thing:

  • the first non-whitespace character of the first line of the interior of the long-string must match the column of the first backtick in the opening delimiter of the long-string, and
  • the first non-whitespace characters of the subsequent lines of the interior of the long-string must be at or after the column of the first backtick in the opening delimiter of the long-string

...or something like that :)

In the above example, the string 123456789 should start directly beneath the first backtick of the opening delimiter of the long-string, but it doesn't.

Some work-arounds are to express such constructs like:

(comment

  (->
    ``
    123456789
    ``
    length)
  # => 9
  
  )

or:

(comment

  (def a-string
    ``
    123456789
    ``)

  (-> a-string
      length)
  # => 9
  
  )

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.