Finch
Copyright(c) Leon Vatthauer 2026
LicenseGPL-3
MaintainerLeon Vatthauer <leon.vatthauer@fau.de>
Stabilityexperimental
Portabilitynon-portable (ghc-wasm-meta)
Safe HaskellNone
LanguageGHC2024

Parser.Rule

Description

This module defines parsers for RuleApplications and References.

Synopsis

Parsers

pLine :: Parser m => m Int Source #

Parses a positive integer as a line number.

pReference :: Parser m => m Reference Source #

Parses a Reference: either a ProofReference (a line range m-n) or a LineReference (a single line number n).

pRule :: Parser m => m RuleApplication Source #

Parses a RuleApplication: a rule name enclosed in parentheses, followed by a comma-separated list of References.

Entry point

parseRuleApplication Source #

Arguments

:: Int

Line number, used to anchor error positions.

-> Text

Input Text to parse.

-> Either Text RuleApplication 

Parses a RuleApplication from a Text. Returns Left with a human-readable error message on failure, or Right with the parsed RuleApplication on success.