Skip to content

Commit

Permalink
add terminology
Browse files Browse the repository at this point in the history
closes #101
  • Loading branch information
Boshen committed May 16, 2024
1 parent 04c66c1 commit 8a879fa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vitepress/config/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const enConfig = defineLocaleConfig("root", {
],
},
{ text: "Performance", link: "/docs/learn/performance" },
{ text: "Terminology", link: "/docs/learn/terminology" },
{ text: "References", link: "/docs/learn/references" },
],
"/docs/contribute/": [
Expand Down
36 changes: 36 additions & 0 deletions src/docs/learn/terminology.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Terminology
outline: deep
---

## Binding

A value being assigned/bound within a scope.

## Binding type

The type of the binding: imported value, assigned value (let/const/var), exported value, func/class declaration, func/method arguments, etc.

## Scope

A block in which bindings can exist. A block is any code surrounded with {}, such as classes, functions, methods, callbacks, if/else, etc. Scopes have a hierarchy, with parents having children (not always), and children belonging to a parent. Bindings in a child shadow those in a parent if they have the same name.

## Scope flags

Metadata about the current scope (not inherited hierarchy scope): function, constructor, top-level (program), etc.

## Symbol

A binding wrapper with references to each usage/call site of the bound variable within the current source text. A symbol is assigned an ID in the order they are scanned, and reach reference points to the symbol by that ID.

## Symbol flags

Metadata about the symbol/binding.

## Reference

A symbol reference is the usage of a symbol (and in turn a binding), and is assigned an ID in the order they are scanned. Each reference is flagged as read, write, or both.

## Span

The start/end offset of the node within the source text.

0 comments on commit 8a879fa

Please sign in to comment.