package orsetto
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=bb2af4d8b376b2d60fa996bd4d3b90d9f3559455672540f6d7c3598af81d483b
    
    
  md5=f7bfa83013801b42fcdba607af2f012b
    
    
  doc/orsetto.cf/Cf_chain_scan/ASCII/index.html
Module Cf_chain_scan.ASCII
A distinguished chain scanner for simple ASCII character symbols.
type chain = private - | Chain : {- separator : unit Cf_scan.ASCII.t;
- header : ctrl;
- trailer : ctrl;
- fail : (Cf_scan.ASCII.mark -> 'x) option;
 - } -> chain
The type of a chain discipline.
val mk : 
  ?xf:(Cf_scan.ASCII.mark -> 'x) ->
  ?a:[< ctrl ] ->
  ?b:[< ctrl ] ->
  'r Cf_scan.ASCII.t ->
  chainUse mk separator to make a chain discipline with separator to scan for delimiters. Use ~a and/or ~b to control how leading/trailing delimiters are processed (respectively). For example, use ~b:`Opt to specify that a trailing delimiter is optionally permitted.
val sep : 
  ?xf:(Cf_scan.ASCII.mark -> 'x) ->
  [< ctrl ] ->
  'r ->
  'r Cf_scan.ASCII.t ->
  'r Cf_scan.ASCII.tUse sep c r p to make a parser for separator p with optionality control c.
If c is `Non then no input is consumed and r is returned.
If c is `Opt then returns either the value recognized by p, or r if no value is recognized.
If c is `Req then acts as reqf ?xf p.
val sep0 : 
  ?xf:(Cf_scan.ASCII.mark -> 'x) ->
  [< ctrl ] ->
  unit Cf_scan.ASCII.t ->
  bool Cf_scan.ASCII.tUse sep0 c p to make a parser for separator p with optionality control c, in the case that p returns the unit type.
If c is `Non then no input is consumed and false is returned.
If c is `Opt then returns a boolean value indicating whether p recognized a separator.
If c is `Req then acts as reqf ?xf p >>= fun () -> return true.
val vis : 
  c:chain ->
  ?a:int ->
  ?b:int ->
  ('r -> 'r Cf_scan.ASCII.t) ->
  'r ->
  'r Cf_scan.ASCII.tUse vis ~c ?a ?b f v to compose a parser that recognizes a sequence of symbols in the input stream, delimited according to the chain discipline ~c, by applying a visitor function f at each sequence point to obtain its parser. The first sequence point is visited with the initializer v.
If ~a is used, then it specifies the minimum number of elements in the sequence. If ~b is used then it specifies the maximum number of elements in the sequence. Composition raises Invalid_argument if a < 0 or b < a.
val seq : 
  c:chain ->
  ?a:int ->
  ?b:int ->
  'r Cf_scan.ASCII.t ->
  'r list Cf_scan.ASCII.tUse seq ?a ?b p to create a new parser that recognizes a sequence of symbols in the input stream with p, delimited according to the chain discipline ~c.
If ~a is used, then it specifies the minimum number of elements in the sequence. If ~b is used then it specifies the maximum number of elements in the sequence. Composition raises Invalid_argument if a < 0 or b < a.