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?
// Types | |
#define NULL 0 | |
typedef unsigned char u8; | |
typedef unsigned int u32; | |
typedef signed int i32; | |
typedef signed long long i64; | |
typedef double f64; | |
// Imports |
// identity mapped type | |
https://www.typescriptlang.org/play?#code/PTAEEsDsAcFcBcBQ8Ce0CmoDyAjAVqALygDeioFoAZgPY0BcoAzvAE5QDmANOZTgIatGkWAFsc6VogC+iRCGqxIAY3jgakZGkwBJACbpIa1AB4AKgD4ipXhQDaAaQiRQAa3QoaVUGYC6jM0dfGTkFZX4AGwitDFAAZX5RTGJ9Q2MUE1w8CyA | |
// promisify mapped type | |
https://www.typescriptlang.org/play?#code/C4TwDgpgBA8gRgKygXigbygMwPbYFxQDOwATgJYB2A5gDRRwCGJBFArgLZwQlQC+AUP1CQoABRLZ2ZQmUwgAPABUAfCnT8omqAG0A0lEpQA1hBDZMURQF0CACgCUKVeMnSISvVeX8BQ8NBcpGUwyCAATNUDpWQV4BG9+MIgAYwAbJmhk7ApiKBIwZIIo4NCwwSyc4CxWYFYSaFR85IA6RhIHQUwauohm4AALCApbWwA3BlTHZFU0DS1x1J97IA | |
// SatisfyName, get access to ur own key in the callback | |
https://www.typescriptlang.org/play?#code/PTAEDMFcDsGMBcCWB7aAoeBPADgU1AMoCGSAzuJgHJEC2uAPACoB8oAvKAN5qigDaAaVCJooANa5MycKEYBdAFygAFNFq4lAgJTtWAN2SIAJgG40AXzNojuWABsiAJ3xQ4SVKFIlE5TAHkAIwArW3hqOiZmZWRgpWIyCnCGFi0lA2MrLwT-YNCk5U5QEFBkSHhsMp5QIiVVdR02Vm4q3jU6M15zABoqgNq23AamltARgY7QbostEyA | |
// provideValue, just pairs of data and callbacks that get *their* data as an argument | |
https://www.typescript |
// these aren't _quite_ functional tests, | |
// and should all be compile_fail, | |
// but may be illustrative | |
#[test] | |
fn concurrent_set() { | |
use std::sync::Arc; | |
let x = Arc::new(Cell::new(42)); | |
let x1 = Arc::clone(&x); | |
std::thread::spawn(move || { |
// @ts-check | |
"use strict" | |
/** | |
* Set up datadog tracing. This should be called first, so Datadog can hook | |
* all the other dependencies like `http`. | |
*/ | |
function setUpDatadogTracing() { | |
const { tracer: Tracer } = require('dd-trace') | |
const tracer = Tracer.init({ |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import configureStore from "./store/configureStore"; | |
const store = configureStore(); | |
const rootEl = document.getElementById("root"); |
/** | |
* When manually subscribing to an observable in a view component, developers are traditionally required | |
* to unsubscribe during ngOnDestroy. This utility method auto-configures and manages that relationship | |
* by watching the DOM with a MutationObserver and internally using the takeUntil RxJS operator. | |
* | |
* Angular 7 has stricter enforcements and throws errors with monkey-patching of view component life-cycle methods. | |
* Here is an updated version that uses MutationObserver to accomplish the same goal. | |
* | |
* @code | |
* |