Comments (10)
@paf31 introduces StringLike
#36 to “support more efficient string representations.”
What kind of representations? The only thing I can think of is something like CatList<String>
, which could be a more efficient “string” representation if the the “string” is a large document which is being edited, or is being lazily read in chunks out of a large file?
from purescript-parsing.
We should combine parsing and string-parsers #69
from purescript-parsing.
https://github.com/Thimoteus/SandScript/wiki/2.-Parsing-recursively
from purescript-parsing.
Here's a parsing monad.
Here's a CPS purescript parsing monad
Adapted from
https://github.com/jonascarpay/alloy/blob/master/src/Parser/Parsec.hs
Adapted from Parsec.
from purescript-parsing.
I would want this library to be as full-featured as possible, and to have these properties (which we mostly already have):
- Stack-safe
- Auto-backtracking (if a parser fails then it consumes no input)
- Monad-transformable
- Input streams extendable with build-in support for
String
UCS-2 Big-EndianString
UCS-2 Little-EndianString
UTF-16 Big-EndianString
UTF-16 Little-EndianUInt8Array
UTF-8DataView
forall token. List<token>
Node.js only supports UTF-16 Little-Endian https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
https://mathiasbynens.be/notes/javascript-encoding
https://kevin.burke.dev/kevin/node-js-string-encoding/
from purescript-parsing.
The purescript-string-parsers Text.Parsing.StringParser.CodePoints
module has the design decision to
- Use a cursor in units of code points.
- Return a
Char
.
A better design would be to
- Use a cursor in units of code units (and increment by two for astral characters)
- Return a
CodePoint
.
purescript-contrib/purescript-string-parsers#48
We could use this getWholeChar
function.
Or actually the CodePoints.uncons
might suffice
from purescript-parsing.
Actually, maybe there is no performance improvement to be had with a cursor-based parser state?
purescript/purescript-strings#120
from purescript-parsing.
Instructions for how to parse a String
with Regex
, then switch to Parser
, then switch back to Regex
. This should be a supported use case, considering that Parser
is 100× slower than Regex
.
Also support the opposite case, with a parseRegex :: Regex -> ParserT String m (Array String)
.
from purescript-parsing.
More package properties
- Does not release (does not free the memory of) input already consumed.
- Does not allow for continuation of more input received (like Attoparsec).
from purescript-parsing.
purescript-parsing/src/Text/Parsing/Parser.purs
Lines 104 to 110 in 297ad9e
I think the purpose of the consumed
flag is to do something like this?
Note that if p succeeds without consuming input the second alternative is favored if it consumes input. This implements the “longest match” rule.
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/parsec-paper-letter.pdf p.11
Except the way that I read this Alt
instance is that it favors p2
if p1
failed and consumed no input.
from purescript-parsing.
Related Issues (20)
- Fix issues caused by making `<|>` infixr HOT 1
- Change Position to Int HOT 3
- Indents
- purescript-datetime-parsing
- Combinator variations HOT 12
- Talk about alternate backends in documentation
- Fully remove the `Parsing.Pos` module? HOT 1
- liftMaybe, liftEither, liftExceptT HOT 4
- MonadST instance for ParserT? HOT 1
- Drop unicode dependency? HOT 5
- `skipSpaces` always commits to branch even if no spaces are consumed HOT 6
- Chris martin's seven parser types HOT 4
- Parsing a `number` in scientific notation _without_ a decimal exponent fails.
- Change “consume” to “commit” HOT 3
- manyIndex ParseError message
- manyMonoid?
- Consider `Parser0` HOT 1
- Multiple errors HOT 7
- withRecovery HOT 2
- Factor out `Tokens` and `Language` HOT 1
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.
from purescript-parsing.