Skip to content

Instantly share code, notes, and snippets.

View jorendorff's full-sized avatar

Jason Orendorff jorendorff

View GitHub Profile
Script :
StatementList?
Module :
StatementList?
StatementList :
Statement
StatementList Statement
"""generate_js_parser_tables.py - Generate tables from the ES grammar."""
import argparse
import os
import jsparagus.gen
import jsparagus.grammar
from .parse_esgrammar import parse_esgrammar
from .lexer import ECMASCRIPT_FULL_KEYWORDS, ECMASCRIPT_CONDITIONAL_KEYWORDS
Tokens after which the next token is never a RegularExpressionLiteral:
BooleanLiteral => div
"Name" => div
NoSubstitutionTemplate => div
NullLiteral => div
NumericLiteral => div
RegularExpressionLiteral => div
StringLiteral => div
TemplateTail => div
~/work/gnzlbg/jemallocator$ cargo build
Compiling jemalloc-sys v0.3.2 (/Users/jorendorff/work/gnzlbg/jemallocator/jemalloc-sys)
error: failed to run custom build command for `jemalloc-sys v0.3.2 (/Users/jorendorff/work/gnzlbg/jemallocator/jemalloc-sys)`
Caused by:
process didn't exit successfully: `/Users/jorendorff/work/gnzlbg/jemallocator/target/debug/build/jemalloc-sys-899111882e61bbc8/build-script-build` (exit code: 101)
--- stdout
TARGET=x86_64-apple-darwin
HOST=x86_64-apple-darwin
NUM_JOBS=8

11.6.2 Reserved Words

A reserved word is an IdentifierName that cannot be used as an Identifier.

Syntax

ReservedWord :: one of
await break case catch class const continue debugger default delete do
else enum export extends false finally for function if import in
instanceof new null return super switch this throw true try typeof var

// Vec.dfy - A sketch of Rust's Vec<T> in Dafny, proving the unsafe operations safe
//
// ### Background
//
// Rust is a systems programming language. `Vec<T>` is the basic growable array
// type in Rust. It's implemented in Rust, using unsafe code; some parts are
// implemented by an underlying `RawVec<T>` type, also using unsafe code.
//
// Dafny is a C#-like programming language with proofs. In Dafny, assertions
// are checked at compile time! If the compiler can't prove that the assertion
module Util {
type usize = nat
type Ptr = nat
function null_ptr(): Ptr { 0 }
predicate is_null(p: Ptr) { p == 0 }
datatype Option<T> = None | Some(value: T)
function range(start: nat, stop: nat): seq<nat>
import pgen_runtime
from pgen_runtime import Apply
actions = [
# 0. <empty>
{'-': 1, 'NUM': 2, 'VAR': 3, '(': 4},
# 1. "-"
{'-': 1, 'NUM': 2, 'VAR': 3, '(': 4},
$ hg log -r tip
changeset: 539025:519828d4a0a5
tag: tip
parent: 538768:93075ec49df3
user: Jason Orendorff <[email protected]>
date: Tue Apr 09 13:11:27 2019 -0500
summary: Bug 1539821 - Part 1: Delete ModifierException::NoneIsOperand. r?jwalden
================================================================================ 2019-04-09 13:11:34
// *** Basics *****************************************************************
// A nonzero number's divisors are the numbers that divide it evenly.
//
// Also called "factors". The divisors of 12 are 1, 2, 3, 4, 6, and 12.
function divisors(k: nat): set<nat>
requires k > 0
{
set n: int | 0 < n <= k && k % n == 0
}