Skip to content

Commit 393ac1d

Browse files
committed
fix parsing |foo bar|
1 parent 0826e2b commit 393ac1d

File tree

8 files changed

+32
-23
lines changed

8 files changed

+32
-23
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.19-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
88
![1.0.0 Complete](https://img.shields.io/github/milestones/progress-percent/jcubic/lips/1?label=1.0.0%20Complete)
99
[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
10-
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&743f5850f78d354efa7dc6171c26e2ad)](https://coveralls.io/github/jcubic/lips?branch=devel)
10+
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&da41214f6f783c85d7b70e67cf72dd49)](https://coveralls.io/github/jcubic/lips?branch=devel)
1111
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
1212
![NPM Download Count](https://img.shields.io/npm/dm/@jcubic/lips)
1313
![JSDelivr Download count](https://img.shields.io/jsdelivr/npm/hm/@jcubic/lips)

dist/lips.cjs

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lips.esm.js

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lips.esm.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lips.js

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lips.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lips.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,8 @@ Lexer.regex_class = Symbol.for('regex_class');
13051305
Lexer.character = Symbol.for('character');
13061306
Lexer.bracket = Symbol.for('bracket');
13071307
Lexer.b_symbol = Symbol.for('b_symbol');
1308+
Lexer.b_symbol_ex = Symbol.for('b_symbol_ex');
1309+
13081310
Lexer.b_comment = Symbol.for('b_comment');
13091311
Lexer.i_comment = Symbol.for('i_comment');
13101312
Lexer.l_datum = Symbol.for('l_datum');
@@ -1373,8 +1375,8 @@ Lexer._rules = [
13731375
[/\|/, null, null, null, Lexer.b_symbol],
13741376
[/\s/, null, null, Lexer.b_symbol, Lexer.b_symbol],
13751377
[/\|/, null, Lexer.boundary, Lexer.b_symbol, null],
1376-
[/\|/, null, /\S/, Lexer.b_symbol, Lexer.b_symbol],
1377-
[/\S/, null, Lexer.boundary, Lexer.b_symbol, null]
1378+
[/\|/, null, /\S/, Lexer.b_symbol, Lexer.b_symbol_ex],
1379+
[/\S/, null, Lexer.boundary, Lexer.b_symbol_ex, null]
13781380
];
13791381
// ----------------------------------------------------------------------
13801382
Lexer._brackets = [

tests/core.scm

+5-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@
148148
(t.is '|\r| (string->symbol "\r"))
149149
(t.is '|\s| 's)
150150
(t.is '|\x3BB;| )
151-
(t.is '|\x9;\x9;| '|\t\t|)))
151+
(t.is '|\x9;\x9;| '|\t\t|)
152+
;; found in
153+
;; https://docs.scheme.org/surveys/reader-vertical-bar-concatenated-with-number/
154+
(t.is (lips.tokenize "|1|aaa |a|b|c| |foo bar|")
155+
#("|1|aaa" "|a|b|c|" "|foo bar|"))))
152156

153157
(test "core: dot comma"
154158
(lambda (t)

0 commit comments

Comments
 (0)