In this tutorial we're going to build a set of parser combinators.
We'll answer the above question in 2 steps.
- What is a parser?
- and, what is a parser combinator?
So first question: What is parser?
| /* ==UserStyle== | |
| @name www.youtube.com | |
| @namespace github.com/openstyles/stylus | |
| @version 1.0.0 | |
| @description A new userstyle | |
| @author noghartt | |
| ==/UserStyle== */ | |
| @-moz-document url-prefix("https://www.youtube.com/") { | |
| /* Remove all references to Shorts. */ |
| const table = { | |
| 666: "0", | |
| 123: "S", | |
| 111: "=", | |
| 112: "+", | |
| 236: " x ", | |
| 362: "(", | |
| 323: ")", | |
| 212: "<", | |
| 213: ">", |
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
| import { fetchQuery, graphql } from 'relay-runtine'; | |
| export const fetchVersion = async (environment) => { | |
| const response = fetchQuery( | |
| environment, | |
| graphql` | |
| query fetchVersionQuery { | |
| version | |
| } | |
| `, |
A list of links containing cool references, resources and things related to books about Computer Science and related.
| import ts from 'typescript'; | |
| import { readFile, writeFile } from 'fs/promises'; | |
| const sourceText = await readFile('./input.ts', { encoding: 'utf8' }); | |
| const source = ts.createSourceFile('input.ts', sourceText, ts.ScriptTarget.Latest); | |
| const newArticle = ts.factory.createObjectLiteralExpression( | |
| [ | |
| ts.factory.createPropertyAssignment( |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- OPML generated by NetNewsWire --> | |
| <opml version="1.1"> | |
| <head> | |
| <title>Subscriptions-OnMyMac.opml</title> | |
| </head> | |
| <body> | |
| <outline text="AAAS: Keyword search for query" title="AAAS: Keyword search for query" description="" type="rss" version="RSS" htmlUrl="https://www.science.org/" xmlUrl="https://www.science.org/blogs/pipeline/feed"/> | |
| <outline text="News" title="News"> | |
| <outline text="Ars Technica - All content" title="Ars Technica - All content" description="" type="rss" version="RSS" htmlUrl="https://arstechnica.com/" xmlUrl="https://feeds.arstechnica.com/arstechnica/index"/> |
| import Paper from '@mui/material/Paper'; | |
| import Table from '@mui/material/Table'; | |
| import TableBody from '@mui/material/TableBody'; | |
| import TableCell from '@mui/material/TableCell'; | |
| import TableContainer from '@mui/material/TableContainer'; | |
| import TableHead from '@mui/material/TableHead'; | |
| import TableRow from '@mui/material/TableRow'; | |
| import { | |
| useReactTable, | |
| getCoreRowModel, |