judge-gen's People
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:
judge-gen/judge-gen/rewrite.janet
Lines 8 to 9 in cca9873
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.