LispReader allows no-ops macros to sneak in certain other forms (namespaced maps, tagged literals and anonymous arguments)

Description

No-op macros are line comments (starting with #! or ;), #_, reader conditional (splicing or not) with no matching feature.
Furthermore once a no-op macro has been read regular whitespace are allowed anew.

Examples:
Namespaced map #foo{:bar :baz}

Tagged literal #inst "2017-04-24T09:11:29.878-00:00"

Anonymous argument: #(do %1)

In addition anonymous arguments implementation is leaky (any %n is accepted as long as n is (-2.0 -1.0] (mapping to %&) and [1.0 Infinity) and any representation can be used (bigdec or bigint or float or integers in any basis).

Environment

None

Activity

Show:
Christophe Grand
April 25, 2017, 1:35 PM

clj2160-2 is clj2160 + two redundant checks that were not removed

Christophe Grand
April 25, 2017, 12:31 PM

The patch extracts the body from the read loop to expose a readSome method that returns either a form or the reader (if no valued form has been read starting at the current position).
This patch also adds a regex pattern to validate anonymous args.

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Christophe Grand

Labels

Approval

Triaged

Patch

Code

Priority

Minor

Affects versions