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?
| import * as path from 'node:path'; | |
| import * as fs from 'node:fs/promises'; | |
| const nodeModules = path.resolve('node_modules'); | |
| let moduleNames = await fs.readdir(nodeModules); | |
| moduleNames = (await Promise.all( | |
| moduleNames.map(async name => { | |
| if (name.startsWith('.')) { | |
| return []; |
| #!/usr/bin/env node | |
| const {existsSync} = require(`fs`); | |
| const {createRequire, createRequireFromPath} = require(`module`); | |
| const {resolve} = require(`path`); | |
| const relPnpApiPath = "../../../../.pnp.js"; | |
| const absPnpApiPath = resolve(__dirname, relPnpApiPath); | |
| const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); |
| #!/bin/bash | |
| set -eux | |
| # borrowed subset range from: https://www.44bits.io/ko/post/optimization_webfont_with_pyftsubnet | |
| OPTS_SUBSET_KO='--text-file=glyphs-ko.txt' | |
| # borrowed subset range from: https://fonts.googleapis.com/css2?family=Prompt&display=swap&subset=thai | |
| OPTS_SUBSET_THAI='--unicodes=U+0E01-0E5B, U+200C-200D, U+25CC, U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB, U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD' |
| // 충돌시 데미지 | |
| const HIT_DAMAGE = 30; | |
| // 충돌 후 무적 시간 | |
| const INVINCIBLE_TIME = 2000; | |
| // 시간당 데미지 | |
| const TICK_DAMAGE = 5; | |
| const gameMachine = Machine({ |
| module.exports = { | |
| stories: [ | |
| '../src/**/*.stories.mdx', | |
| '../src/**/*.stories.@(js|jsx|ts|tsx)', | |
| ], | |
| addons: [ | |
| '@storybook/addon-links', | |
| '@storybook/addon-essentials', | |
| ], | |
| webpackFinal: async config => { |
| export type UserContext = { | |
| }; | |
| type UserSuccessContext = UserContext & { | |
| user: User; | |
| }; | |
| type UserErrorContext = UserContext & { | |
| error: Error; | |
| }; |
| directive @db(name: String!) on FIELD_DEFINITION | OBJECT | |
| directive @relationTable on OBJECT | |
| directive @id on FIELD_DEFINITION | |
| directive @unique on FIELD_DEFINITION | |
| directive @createdAt on FIELD_DEFINITION | |
| directive @updatedAt on FIELD_DEFINITION | |
| directive @default(value: Any) on FIELD_DEFINITION | |
| directive @relation(link: RelationLink! = TABLE, name: String) on FIELD_DEFINITION | |
| enum RelationLink { |
| tap "homebrew/bundle" | |
| tap "homebrew/cask" | |
| tap "homebrew/cask-versions" | |
| tap "homebrew/core" | |
| tap "instantclienttap/instantclient" | |
| tap "jesseduffield/lazygit" | |
| tap "lqez/npk" | |
| cask "java" | |
| cask "java8" | |
| brew "ansible" |