This is a SCRIPT-8 cassette.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rec = lambda f: lambda x: f(f, x) | |
fat = rec(lambda f, x: 1 if x <= 1 else x * f(f, x - 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('hello world') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
om typing import Tuple, Callable, Any, List | |
ST = Tuple[int, str] | |
Parser = Callable[[ST], Tuple[ST, Any]] | |
def error(st, msg): | |
return SyntaxError(msg) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src = "" | |
pos = 0 | |
def loads(text: str) -> object: | |
""" | |
Carrega um documento JSON e retorna o valor Python correspondente. | |
""" | |
global src, pos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# -- Sheet -- | |
from time import sleep | |
DEV_MODE = 0 | |
if DEV_MODE: | |
CARACTERES_DT = 0.0 | |
LINHAS_DT = 0.05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Reader: | |
def __init__(self, src, pos=0): | |
self.src = src.strip() | |
self.pos = pos | |
def read(self, st): | |
""" | |
Lê sub-string "st" na posição atual. | |
""" | |
if not self.src.startswith(st, self.pos): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cabala = """ | |
a - 1 | |
b - 2 | |
c - 3 | |
d - 4 | |
e - 5 | |
f - 6 | |
g - 7 | |
h - 8 | |
i - 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple, Callable, Any, List | |
ST = Tuple[int, str] | |
Parser = Callable[[ST], Tuple[ST, Any]] | |
def error(st, msg): | |
return SyntaxError(msg) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple, Callable, Any, List, Union | |
ST = Tuple[int, str] | |
AnyParser = Union["Parser", str] | |
class Parser: | |
""" | |
Objeto responsável por ler um padrão de texto com uma chamada ao método | |
Parser.parse(). |
OlderNewer