Skip to content

Commit bcd3337

Browse files
committed
(docs) fix grammar errors
1 parent 2af822c commit bcd3337

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/blog/2025-02-20-lexer.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The limitation of syntax extension lead into introducing a new Lexer and a Strea
4141
Parser (if you're interested in this topic I will be writing an article about this in the
4242
future).
4343

44-
The new Lexer is much simpler and easier to maintain, only had one bug recenly related to
44+
The new Lexer is much simpler and easier to maintain, only had one bug recently related to
4545
Lexer inner working ([#433](https://github.com/jcubic/lips/issues/433)).
4646

4747
The new Lexer is a class that have rules for the state machine, this is an example
@@ -62,7 +62,7 @@ Lexer._rules = [
6262
]
6363
```
6464

65-
The single rule is consisted of a currect character, next character, and a previous
65+
The single rule is consisted of a current character, next character, and a previous
6666
character (they can be single character strings or regular expressions). If the character
6767
is null it can be any character. The last two elements of the array are the starting and
6868
the ending state (they are symbols so they are unique values).
@@ -82,7 +82,7 @@ That's why in above example there are no rule like this:
8282

8383
This rule may be added in the future to speed up the Lexer.
8484

85-
### Exmaple
85+
### Example
8686

8787
When we have a string like this:
8888

@@ -91,11 +91,11 @@ When we have a string like this:
9191
```
9292

9393
It matches the second rule because the first character is a quote, so it enters
94-
`Lexer.string` state. The first rule don't match becuase the inital state is null. For
95-
characters `foo` it collects the tokens becasue no rule match them. When it finds slash
94+
`Lexer.string` state. The first rule don't match because the initial state is null. For
95+
characters `foo` it collects the tokens because no rule match them. When it finds slash
9696
`\` it changes state from `Lexer.string` to `Lexer.string_escape`, and for next character
9797
it enters again `Lexer.string`. Then it consumes sequence of characters `bar`, and the
98-
last quote maches the first rule. And that's how we have the full token.
98+
last quote matches the first rule. And that's how we have the full token.
9999

100100
### Syntax Extensions and Constants
101101

@@ -118,6 +118,6 @@ maintain. If you want to look how it works for yourself. You can jump into
118118
search for `"class Lexer"`, `"Lexer._rule"`, `Object.defineProperty(Lexer, 'rules'`.
119119

120120
The source code is in one file, so to navigate you need to use search. I've made an attempt to split
121-
the code into modules, but failed. Becuse of Rollup errors about circular dependencies.
121+
the code into modules, but failed. Because of Rollup errors about circular dependencies.
122122

123123
This was first part of articles about [LIPS Scheme Internals](https://github.com/jcubic/lips/issues/437).

0 commit comments

Comments
 (0)