Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ This project was born during a hackathon and follows a simple, collective govern
## Roles

### Core Maintainers

The project is currently maintained by its three original authors:

- **Javier Manotas Ruiz**
- **Javier Nogueira Vera**
- **Daniel Queijo Seoane**
Expand Down
89 changes: 88 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Learning to code often feels abstract. **stepcode** bridges the gap between stat
To build the static site from the content directory:

```bash
uv run src/main.py content
uv run src/main.py docs
```

The output will be generated in the `dist` directory.
Expand Down Expand Up @@ -100,6 +100,93 @@ stepcode
└── LICENSE.txt # GPL-3.0 License details
```

### Interpreter diagram

```mermaid
---
config:
theme: neo-dark
look: classic
---
classDiagram
class Lexer {
+input: String
+position: Number
+line: Number
+column: Number
+tokens: Array
+indentStack: Array
+tokenize() Array
+advance() String
+peek() String
+isAtEnd() Boolean
+isDigit(c) Boolean
+isAlpha(c) Boolean
+isAlphaNumeric(c) Boolean
+skipComment()
+number()
+identifier()
+addToken(type, value)
}

class Parser {
+tokens: Array
+current: Number
+parse() Object
+parseStatement() Object
+parseFunctionDeclaration() Object
+parseIfStatement() Object
+parseWhileStatement() Object
+parseUntilStatement() Object
+parseRepeatStatement() Object
+parseForStatement() Object
+parseReturnStatement() Object
+parseExpressionOrAssignment() Object
+parseBlock() Array
+parseExpression() Object
+parseOr() Object
+parseAnd() Object
+parseEquality() Object
+parseComparison() Object
+parseTerm() Object
+parseFactor() Object
+parseUnary() Object
+parseCallOrAccess() Object
+parsePrimary() Object
+match(type) Boolean
+matchKeyword(keyword) Boolean
+matchOperator(operator) Boolean
+matchPunctuation(punc) Boolean
+check(type) Boolean
+checkPunctuation(punc) Boolean
+consume(type, message) Object
+consumeKeyword(keyword, message) Object
+consumeOperator(operator, message) Object
+consumePunctuation(punc, message) Object
+consumeStatementEnd()
+advance() Object
+isAtEnd() Boolean
+peek() Object
+previous() Object
+error(token, message) Error
}

class Interpreter {
<<module>>
+evaluateExpression(expr, stack, functions, evalState)
+step(ast, state)
}

class Index {
<<module>>
+parse(input) Object
}
Index ..> Lexer : uses
Index ..> Parser : uses
Parser ..> Lexer : consumes tokens
Index ..> Interpreter : uses step()
```

## Roadmap

- [ ] **Complex Data Structures**: Support for arrays, lists, and objects in the interpreter.
Expand Down
3 changes: 2 additions & 1 deletion docs/contribute/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ uv run src/main.py docs
```

## Using nix
If you are a [nix](https://nixos.org/) user, you can use the `devShell` provided by the `flake.nix` to easily set up a development environment with all the necessary dependencies. To enter the development shell, run:

If you are a [nix](https://nixos.org/) user, you can use the `devShell` provided by the `flake.nix` to easily set up a development environment with all the necessary dependencies. To enter the development shell, run:

```sh
nix develop .
Expand Down