tricu

A lazy functional language based on Tree Calculus
Log | Files | Refs | README | LICENSE

parser-demo.json (18482B)


      1 {
      2   "id": "parser",
      3   "source": "!import 6aa33a710955e5746f322775b9078f57ba4145f6b723ff4b76a292285e919823 *\n!import 14282088469cc420dd014700da06998f6bb8dcf990fc885a464c0a1e1858e20d *\n!import 7f87549d587fa8c3be88af0ea988db3adcc3b35f1ffb48973553491b075614db as N\n!export parseNames\n!export parsePrefix\n\n-- Lowercase names separated by commas. Try \"red,green\", \"red,,blue\",\n-- \"red,\" and \"red green\". A comma commits to another name.\n-- parseNames requires the entire input; parsePrefix exposes any remainder.\n-- Edit the parser or labels below; valid edits compile locally.\n-- Imports pin complete library interfaces, fetched only when compiling.\nnameParser = parserSatisfy (c : N.inRange c 97 122)\n  |> parserSome\n  |> parserLabel \"lowercase name\"\ncommaParser = parserThen (parserExpect 44) parserCommit\nnamesPrefix = parserSepBy1 nameParser commaParser\nnamesComplete = parserBefore namesPrefix <| parserLabel \"end of input\" parserEof\n\nreport reply = parserMatchReply\n  (diagnostic rest consumed committed : [\n    [\"status\" 0 \"error\"]\n    [\"expected\" 0 (parserDiagnosticExpected diagnostic)]\n    [\"remaining\" 0 rest]\n    [\"consumed\" 2 consumed]\n    [\"committed\" 2 committed]])\n  (names rest consumed committed : [\n    [\"status\" 0 \"ok\"]\n    [\"names\" 0 (intercalate \", \" names)]\n    [\"count\" 1 (length names)]\n    [\"remaining\" 0 rest]\n    [\"consumed\" 2 consumed]\n    [\"committed\" 2 committed]])\n  reply\nparseNames text = namesComplete text |> report\nparsePrefix text = namesPrefix text |> report\n",
      4   "hash": "355e41506f39e05da8c8a72a68aa810a486e062480322bac11af67e86980520e",
      5   "mode": "pure",
      6   "compilerSha256": "819ad1c86fbf2d6f86533439217146eb9ffd37ca7f95bb278063a28f0ab5b534",
      7   "sourceSha256": "9c005993cf43c07ec5c7e4f7f420b2f63c66e605d9522ab4b7e044de5e6cb8df",
      8   "haskellCases": [
      9     {
     10       "export": "parseNames",
     11       "arguments": [
     12         "220210202021021021002210202102020210210022020210202021021002202021021020210022102102102020210210022021020202102102100221020210202021021002210202102020210210022021021021020210210022020210210202100220210202020210210022020210210202102100221020210202102102100221020210202021021000"
     13       ],
     14       "input": null,
     15       "terminal": "",
     16       "result": "22221021020202102102100220202102021021021002210202020202102100220202102021021021002210202102021021021002210210202021021021000202221021021021020210210022102102021020210210000222202102102102021021002210202020202102100221020210210202102100221020210202021021002210210202021021021000202220210202021021021002210202102020210210022020210202021021002202021021020210022020202020210022102102102020210210022021020202102102100221020210202021021002210202102020210210022021021021020210210022020210210202100220202020202100220210202020210210022020210210202102100221020210202102102100221020210202021021000022221021020202021021002210210210210202102100221020210202102102100220210210210202102100220202102021021021000221002210210002222021020202102102100221020210202021021002210202102102021021002210202020202102100221020202102021021002202102102102021021002210202021020210210022021021021020210210022102102102020210210002020022221021020202021021002210210210210202102100220210210210202102100221021020202102102100221020210202102102100221020210210202102100221020210202021021002202021020202102100022021002100222210210202020210210022102102102102021021002210202102102021021002210202102102021021002210202021020210210022020210202102102100220202102021021021002210202102020210210022020210202021021000220210021000"
     17     },
     18     {
     19       "export": "parseNames",
     20       "arguments": [
     21         "220210202021021021002210202102020210210022020210202021021000"
     22       ],
     23       "input": null,
     24       "terminal": "",
     25       "result": "2222102102020210210210022020210202102102100221020202020210210022020210202102102100221020210202102102100221021020202102102100020222102102102102021021002210210202102021021000022220210210210202102100221020202020210210022102021021020210210022102021020202102100221021020202102102100020222021020202102102100221020210202021021002202021020202102100002222102102020202102100221021021021020210210022102021020210210210022021021021020210210022020210202102102100022100221000222202102020210210210022102021020202102100221020210210202102100221020202020210210022102020210202102100220210210210202102100221020202102021021002202102102102021021002210210210202021021000202002222102102020202102100221021021021020210210022021021021020210210022102102020210210210022102021020210210210022102021021020210210022102021020202102100220202102020210210002202100210022221021020202021021002210210210210202102100221020210210202102100221020210210202102100221020202102021021002202021020210210210022020210202102102100221020210202021021002202021020202102100022021002000"
     26     },
     27     {
     28       "export": "parseNames",
     29       "arguments": [
     30         "220210202021021021002210202102020210210022020210202021021002202021021020210022020210210202100220210202020210210022020210210202102100221020210202102102100221020210202021021000"
     31       ],
     32       "input": null,
     33       "terminal": "",
     34       "result": "22221021020202102102100220202102021021021002210202020202102100220202102021021021002210202102021021021002210210202021021021000202221020210202021021002202102020210210210022021020202102102100221021021021020210210022021020202102102100002222102021020202102100220202021021021021002202020202102102100221020210202021021002210210202020210210022020210202102102100221020210202021021002202021020202102100020222020210210202102100221021021021020210210022102102102021021021002210202102020210210022021020202102102100221021020202021021002210202020202102100221021020202102102100221020210202021021002202020202021002202102102102021021002210202020202102100221020210210202102100221020210202021021000022220210202021021021002210202102020210210022102021021020210210022102020202021021002210202021020210210022021021021020210210022102020210202102100220210210210202102100221021021020202102100020222020210210202100220210202020210210022020210210202102100221020210202102102100221020210202021021000022221021020202021021002210210210210202102100220210210210202102100221021020202102102100221020210202102102100221020210210202102100221020210202021021002202021020202102100022021002100222210210202020210210022102102102102021021002210202102102021021002210202102102021021002210202021020210210022020210202102102100220202102021021021002210202102020210210022020210202021021000220210021000"
     35     },
     36     {
     37       "export": "parseNames",
     38       "arguments": [
     39         "22021020202102102100221020210202021021002202021020202102100220202102102021000"
     40       ],
     41       "input": null,
     42       "terminal": "",
     43       "result": "2222102102020210210210022020210202102102100221020202020210210022020210202102102100221020210202102102100221021020202102102100020222102021020202102100220210202021021021002202102020210210210022102102102102021021002202102020210210210000222210202102020210210022020202102102102100220202020210210210022102021020202102100221021020202021021002202021020210210210022102021020202102100220202102020210210002022202021021020210210022102102102102021021002210210210202102102100221020210202021021002202102020210210210022102102020202102100221020202020210210022102102020210210210022102021020202102100220202020202100220210210210202102100221020202020210210022102021021020210210022102021020202102100002222021020202102102100221020210202021021002210202102102021021002210202020202102100221020202102021021002202102102102021021002210202021020210210022021021021020210210022102102102020210210002020022221021020202021021002210210210210202102100220210210210202102100221021020202102102100221020210202102102100221020210210202102100221020210202021021002202021020202102100022021002100222210210202020210210022102102102102021021002210202102102021021002210202102102021021002210202021020210210022020210202102102100220202102021021021002210202102020210210022020210202021021000220210021000"
     44     },
     45     {
     46       "export": "parseNames",
     47       "arguments": [
     48         "0"
     49       ],
     50       "input": null,
     51       "terminal": "",
     52       "result": "22221021020202102102100220202102021021021002210202020202102100220202102021021021002210202102021021021002210210202021021021000202221020210202021021002202102020210210210022021020202102102100221021021021020210210022021020202102102100002222102021020202102100220202021021021021002202020202102102100221020210202021021002210210202020210210022020210202102102100221020210202021021002202021020202102100020222020210210202102100221021021021020210210022102102102021021021002210202102020210210022021020202102102100221021020202021021002210202020202102100221021020202102102100221020210202021021002202020202021002202102102102021021002210202020202102100221020210210202102100221020210202021021000022220210202021021021002210202102020210210022102021021020210210022102020202021021002210202021020210210022021021021020210210022102020210202102100220210210210202102100221021021020202102100020200222210210202020210210022102102102102021021002202102102102021021002210210202021021021002210202102021021021002210202102102021021002210202102020210210022020210202021021000220210020022221021020202021021002210210210210202102100221020210210202102100221020210210202102100221020202102021021002202021020210210210022020210202102102100221020210202021021002202021020202102100022021002000"
     53     },
     54     {
     55       "export": "parseNames",
     56       "arguments": [
     57         "22021020202102021002210202102020210210022020210202021021000"
     58       ],
     59       "input": null,
     60       "terminal": "",
     61       "result": "222210210202021021021002202021020210210210022102020202021021002202021020210210210022102021020210210210022102102020210210210002022210202102020210210022021020202102102100220210202021021021002210210210210202102100220210202021021021000022221020210202021021002202020210210210210022020202021021021002210202102020210210022102102020202102100220202102021021021002210202102020210210022020210202021021000202220202102102021021002210210210210202102100221021021020210210210022102021020202102100220210202021021021002210210202020210210022102020202021021002210210202021021021002210202102020210210022020202020210022021021021020210210022102020202021021002210202102102021021002210202102020210210000222202102020210210210022102021020202102100221020210210202102100221020202020210210022102020210202102100220210210210202102100221020202102021021002202102102102021021002210210210202021021000202220210202021020210022102021020202102100220202102020210210000222210210202020210210022102102102102021021002202102102102021021002210210202021021021002210202102021021021002210202102102021021002210202102020210210022020210202021021000220210020022221021020202021021002210210210210202102100221020210210202102100221020210210202102100221020202102021021002202021020210210210022020210202102102100221020210202021021002202021020202102100022021002000"
     62     },
     63     {
     64       "export": "parseNames",
     65       "arguments": [
     66         "220210202021021021002210202102020210210022020210202021021002202020202021002210210210202021021002202102020210210210022102021020202102100221020210202021021002202102102102021021000"
     67       ],
     68       "input": null,
     69       "terminal": "",
     70       "result": "2222102102020210210210022020210202102102100221020202020210210022020210202102102100221020210202102102100221021020202102102100020222102021020202102100220210202021021021002202102020210210210022102102102102021021002202102020210210210000222210202102020210210022020202102102102100220202020210210210022102021020202102100221021020202021021002202021020210210210022102021020202102100220202102020210210002022210202102020210210022021021021020210210022020210202021021002202020202021002210210210210202102100220210210202021021002202020202021002210202021020210210022021021021020210210022020202021021021002210202102021021021002202021020210210210000222202102020210210210022102021020202102100221020210210202102100221020202020210210022102020210202102100220210210210202102100221020202102021021002202102102102021021002210210210202021021000202220202020202100221021021020202102100220210202021021021002210202102020210210022102021020202102100220210210210202102100002222102102020202102100221021021021020210210022021021021020210210022102102020210210210022102021020210210210022102021021020210210022102021020202102100220202102020210210002202100210022221021020202021021002210210210210202102100221020210210202102100221020210210202102100221020202102021021002202021020210210210022020210202102102100221020210202021021002202021020202102100022021002000"
     71     },
     72     {
     73       "export": "parseNames",
     74       "arguments": [
     75         "220210202021021021002210202102020210210022020210202021021002202021021020210022102102102020210210022021020202102102100221020210202021021002210202102020210210022021021021020210210022102020202021000"
     76       ],
     77       "input": null,
     78       "terminal": "",
     79       "result": "222210210202021021021002202021020210210210022102020202021021002202021020210210210022102021020210210210022102102020210210210002022210202102020210210022021020202102102100220210202021021021002210210210210202102100220210202021021021000022221020210202021021002202020210210210210022020202021021021002210202102020210210022102102020202102100220202102021021021002210202102020210210022020210202021021000202221020210202021021002202102102102021021002202021020202102100220202020202100221021021021020210210022021021020202102100220202020202100221020202102021021002202102102102021021002202020202102102100221020210202102102100220202102021021021000022220210202021021021002210202102020210210022102021021020210210022102020202021021002210202021020210210022021021021020210210022102020210202102100220210210210202102100221021021020202102100020222102020202021000022221021020202021021002210210210210202102100220210210210202102100221021020202102102100221020210202102102100221020210210202102100221020210202021021002202021020202102100022021002100222210210202020210210022102102102102021021002210202102102021021002210202102102021021002210202021020210210022020210202102102100220202102021021021002210202102020210210022020210202021021000220210021000"
     80     },
     81     {
     82       "export": "parsePrefix",
     83       "arguments": [
     84         "220210202021021021002210202102020210210022020210202021021002202020202021002210210210202021021002202102020210210210022102021020202102100221020210202021021002202102102102021021000"
     85       ],
     86       "input": null,
     87       "terminal": "",
     88       "result": "2222102102020210210210022020210202102102100221020202020210210022020210202102102100221020210202102102100221021020202102102100020222102102102102021021002210210202102021021000022220210210210202102100221020202020210210022102021021020210210022102021020202102100221021020202102102100020222021020202102102100221020210202021021002202021020202102100002222102102020202102100221021021021020210210022102021020210210210022021021021020210210022020210202102102100022100221000222202102020210210210022102021020202102100221020210210202102100221020202020210210022102020210202102100220210210210202102100221020202102021021002202102102102021021002210210210202021021000202220202020202100221021021020202102100220210202021021021002210202102020210210022102021020202102100220210210210202102100002222102102020202102100221021021021020210210022021021021020210210022102102020210210210022102021020210210210022102021021020210210022102021020202102100220202102020210210002202100210022221021020202021021002210210210210202102100221020210210202102100221020210210202102100221020202102021021002202021020210210210022020210202102102100221020210202021021002202021020202102100022021002000"
     89     },
     90     {
     91       "export": "parsePrefix",
     92       "arguments": [
     93         "220210202021021021002210202102020210210022020210202021021002202021021020210022102102102020210210022021020202102102100221020210202021021002210202102020210210022021021021020210210022102020202021000"
     94       ],
     95       "input": null,
     96       "terminal": "",
     97       "result": "2222102102020210210210022020210202102102100221020202020210210022020210202102102100221020210202102102100221021020202102102100020222102102102102021021002210210202102021021000022220210210210202102100221020202020210210022102021021020210210022102021020202102100221021020202102102100020222021020202102102100221020210202021021002202021020202102100220202102102021002202020202021002210210210202021021002202102020210210210022102021020202102100221020210202021021002202102102102021021000022221021020202021021002210210210210202102100221020210202102102100220210210210202102100220202102021021021000221002202100022220210202021021021002210202102020210210022102021021020210210022102020202021021002210202021020210210022021021021020210210022102020210202102100220210210210202102100221021021020202102100020222102020202021000022221021020202021021002210210210210202102100220210210210202102100221021020202102102100221020210202102102100221020210210202102100221020210202021021002202021020202102100022021002100222210210202020210210022102102102102021021002210202102102021021002210202102102021021002210202021020210210022020210202102102100220202102021021021002210202102020210210022020210202021021000220210021000"
     98     },
     99     {
    100       "export": "parsePrefix",
    101       "arguments": [
    102         "22021020202102102100221020210202021021002202021020202102100220202102102021000"
    103       ],
    104       "input": null,
    105       "terminal": "",
    106       "result": "2222102102020210210210022020210202102102100221020202020210210022020210202102102100221020210202102102100221021020202102102100020222102021020202102100220210202021021021002202102020210210210022102102102102021021002202102020210210210000222210202102020210210022020202102102102100220202020210210210022102021020202102100221021020202021021002202021020210210210022102021020202102100220202102020210210002022202021021020210210022102102102102021021002210210210202102102100221020210202021021002202102020210210210022102102020202102100221020202020210210022102102020210210210022102021020202102100220202020202100220210210210202102100221020202020210210022102021021020210210022102021020202102100002222021020202102102100221020210202021021002210202102102021021002210202020202102100221020202102021021002202102102102021021002210202021020210210022021021021020210210022102102102020210210002020022221021020202021021002210210210210202102100220210210210202102100221021020202102102100221020210202102102100221020210210202102100221020210202021021002202021020202102100022021002100222210210202020210210022102102102102021021002210202102102021021002210202102102021021002210202021020210210022020210202102102100220202102021021021002210202102020210210022020210202021021000220210021000"
    107     }
    108   ]
    109 }