elm / parser

A parsing library, focused on simplicity and great error messages
https://package.elm-lang.org/packages/elm/parser/latest
BSD 3-Clause "New" or "Revised" License
230 stars 46 forks source link

Indent default value is 1, not 0 #24

Open mdgriffith opened 5 years ago

mdgriffith commented 5 years ago

getIndent has a default of 1 as opposed to 0 as mentioned in the docs.

module Main exposing (main)

import Html exposing (text)
import Parser

main =
    case Parser.run Parser.getIndent "" of
        Ok indent ->
            text (String.fromInt indent)

        Err err ->
            text "something atrocious"

https://ellie-app.com/3Z2FRkCJP8Ba1

(I've been having such a ball writing a parser, thank you so much for this package)