Skip to content
Open
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
372d5a0
WIP
msujew Jun 29, 2026
783ca2f
Generate code
msujew Jun 29, 2026
56544a1
Make my grammar changes
Lotes Jun 29, 2026
df2e77f
Rename Token
Lotes Jun 30, 2026
a6d990a
Go back some steps
Lotes Jun 30, 2026
2d1b3f2
Intermediate save
Lotes Jun 30, 2026
8519c9d
Quick save
Lotes Jun 30, 2026
632e383
Quick save
Lotes Jul 1, 2026
02aa2e7
Last corrections
Lotes Jul 1, 2026
3c6ec5b
Add main generated files
Lotes Jul 1, 2026
2711af2
Fix examples
Lotes Jul 1, 2026
b04b0aa
Fix token groups internal language
Lotes Jul 1, 2026
c2e7ac8
Fix lookahead internal language
Lotes Jul 1, 2026
29da360
Fix completion internal language
Lotes Jul 1, 2026
d8b5018
Quick save
Lotes Jul 2, 2026
54241cb
Quick save
Lotes Jul 6, 2026
0149f08
Fix lexer mode pushing/popping
Lotes Jul 6, 2026
c0ec067
Save generated files
Lotes Jul 6, 2026
90bfda9
Add parser tests for nested strings
Lotes Jul 6, 2026
1a70f71
Quick save
Lotes Jul 6, 2026
8b334af
Rename back
Lotes Jul 6, 2026
6d9826f
Fix grammar for keywords
Lotes Jul 6, 2026
9f214c7
Bootstrap
Lotes Jul 6, 2026
8aedf4b
Add some util tests
Lotes Jul 7, 2026
3311a90
Fix keyword positions
Lotes Jul 7, 2026
27ed915
Fix statemachine grammar
Lotes Jul 7, 2026
3948ade
Quick save
Lotes Jul 7, 2026
a4e1ae5
Add TokenTypeUsage
Lotes Jul 7, 2026
bbd3092
Add TokenModeMembers to token modes
Lotes Jul 7, 2026
2378a6d
Bootstrap
Lotes Jul 7, 2026
5138e02
Fix bootstrap
Lotes Jul 7, 2026
97bf057
Remove keywords by AstNode
Lotes Jul 7, 2026
020f692
Bootstrap
Lotes Jul 7, 2026
861285c
Clean up
Lotes Jul 7, 2026
0fedd6b
Add token mode's keyword usages + Bootstrap
Lotes Jul 8, 2026
fcde537
Generate token modes language
Lotes Jul 8, 2026
6e6f85d
Add a validation for unique token mode names
Lotes Jul 9, 2026
135e8ce
Fix lookahead language
Lotes Jul 9, 2026
0c80b32
Fix token_groups language
Lotes Jul 9, 2026
88fa1d3
Add keyword selector for token modes
Lotes Jul 9, 2026
210026f
Add token decls inside token modes
Lotes Jul 10, 2026
0324ad1
Fix scoping
Lotes Jul 10, 2026
74e00b8
Add group type and command to token groups
Lotes Jul 10, 2026
4768d8b
Reduce redundancy when computing token modes
Lotes Jul 10, 2026
91636f0
Split out lexer util functions
Lotes Jul 10, 2026
a9734fb
Split generate token types
Lotes Jul 10, 2026
61c65cc
Refactor collecting of lexer information
Lotes Jul 10, 2026
23d0e79
Fix validation about unassigned rules
Lotes Jul 10, 2026
5546120
Reintroduced another open TODO
Lotes Jul 10, 2026
19ef6ac
Fix two crossref tests
Lotes Jul 10, 2026
ea2fba5
Fix test about token group contaiining invalid token ref
Lotes Jul 10, 2026
2be06e4
Apply review comments
Lotes Jul 14, 2026
ae31604
Reduce nesting by refactor out sub function
Lotes Jul 14, 2026
0423905
Fix generated types
Lotes Jul 14, 2026
51de507
Add a benchmark test
Lotes Jul 14, 2026
c87189e
Fix linting errors
Lotes Jul 14, 2026
e9cbc14
Revert Fastbelt main grammar
Lotes Jul 17, 2026
4a65240
Shorten completion grammar
Lotes Jul 17, 2026
7499f0d
Add more unique rule name validations
Lotes Jul 17, 2026
1a03eba
Fix rebase
Lotes Aug 4, 2026
40f2d9d
Rename GroupType to TokenModifier
Lotes Aug 4, 2026
efb5b0e
Fix recovery and check token names for nil
Lotes Aug 6, 2026
b1269aa
Add diagnostic for required default token mode
Lotes Aug 6, 2026
fb2bd56
Add new validations
Lotes Aug 6, 2026
10dcc56
Add more tests
Lotes Aug 6, 2026
30ffbf3
Fix `token_modes.fb` STRING_CONTENT rule
Lotes Aug 6, 2026
b6c72e9
Persist more decisions
Lotes Aug 6, 2026
4373189
Add code about non-cross-file-token-modes
Lotes Aug 6, 2026
a7fcf72
Update docs
Lotes Aug 6, 2026
ccc62a4
Remove TODO.md
Lotes Aug 6, 2026
a65e2fc
Revert statemachine and arithmetics example
Lotes Aug 12, 2026
75a8725
Renamed groups and token types to token modifiers
Lotes Aug 12, 2026
e3eb7fd
Remove unrelevant capacity, remove parser from lexer benchmark
Lotes Aug 12, 2026
051248c
Use WaitGroup.Go(...)
Lotes Aug 12, 2026
be87ad5
Remove doc.FindAstNode(...)
Lotes Aug 12, 2026
9dae3d7
Add test for unreachable token mode cycle
Lotes Aug 12, 2026
a6383d4
Add more validations
Lotes Aug 13, 2026
d0ecac4
Add validations
Lotes Aug 13, 2026
823998d
Fix tests
Lotes Aug 13, 2026
3e0f309
Add another validation
Lotes Aug 13, 2026
71d3b2f
Removed the prefix from state number enum
Lotes Aug 13, 2026
557bdc7
Finish rebasing with MAIN branch
Lotes Aug 13, 2026
032e9ff
Remove unused private function
Lotes Aug 13, 2026
82acc18
Fix first comments
Lotes Aug 24, 2026
8689336
Renamed token elements
Lotes Aug 24, 2026
cc6ec6a
Quick save
Lotes Aug 26, 2026
f9aa3bf
Quick save
Lotes Aug 26, 2026
9d022fa
Fix tests finally
Lotes Aug 26, 2026
c881a9c
Remove linting issues
Lotes Aug 26, 2026
933feaa
Replace repeating message with single function call
Lotes Aug 26, 2026
a22f6d3
Add more suggestions from review comments
Lotes Aug 26, 2026
a6b6648
Add RegExpLiteral validation
Lotes Aug 26, 2026
4bc558d
Add token group names
Lotes Aug 26, 2026
ffc9594
Add all names instead
Lotes Aug 26, 2026
c675703
Fix comments
Lotes Aug 27, 2026
80519c5
Next 2 findings
Lotes Aug 27, 2026
4b67934
Fix markdown token names
Lotes Aug 27, 2026
37b4f28
Update docs, resolve more comments
Lotes Aug 27, 2026
7679148
Fix wording of groups to modifiers
Lotes Aug 27, 2026
2a049b2
Add docs
Lotes Aug 27, 2026
7d31402
Add brief explanation
Lotes Aug 27, 2026
ad4e967
Quick save
Lotes Aug 31, 2026
26be6de
Add documentation
Lotes Aug 31, 2026
2d29780
Rephrase docs
Lotes Aug 31, 2026
c6640c2
Fix docs
Lotes Aug 31, 2026
032a230
Polishing comments
Lotes Sep 1, 2026
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
30 changes: 29 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,34 @@
"outFiles": [
"${workspaceFolder}/internal/vscode-extensions/statemachine/dist/**/*.js"
]
}
},
{
Comment thread
Lotes marked this conversation as resolved.
"name": "TokenModesWithGroups Generator",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/fastbelt",
"cwd": "${workspaceFolder}/internal/languages/token_modes_with_groups",
"args": [
"generate",
"token_modes_with_groups.fb",
"-v",
"--atn"
]
},
{
"name": "Completion Generator",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/fastbelt",
"cwd": "${workspaceFolder}/internal/languages/completion",
"args": [
"generate",
"completion.fb",
"-v",
"--atn"
]
},
Comment thread
Lotes marked this conversation as resolved.
]
}
2 changes: 1 addition & 1 deletion examples/arithmetics/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func BenchmarkParser(b *testing.B) {
srv := CreateServices()
lexerService := service.MustGet[lexer.Lexer](srv)
parserService := service.MustGet[parser.Parser](srv)
lexed := lexerService.Lex(content)
lexed := lexerService.Exec(content)
if len(lexed.Errors) > 0 {
b.Fatalf("lexer errors: %v", lexed.Errors)
}
Expand Down
98 changes: 25 additions & 73 deletions examples/arithmetics/lexer_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/statemachine/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func BenchmarkParser(b *testing.B) {
srv := CreateServices()
lexerService := service.MustGet[lexer.Lexer](srv)
parserService := service.MustGet[parser.Parser](srv)
tokens := lexerService.Lex(content).Tokens
tokens := lexerService.Exec(content).Tokens
doc, err := fastbelt.NewDocumentFromString("file:///workspace/statemachine_0.statemachine", "statemachine", content)
if err != nil {
b.Fatal(err)
Expand All @@ -148,7 +148,7 @@ func BenchmarkLexer(b *testing.B) {
b.SetBytes(int64(len(content)))
b.ResetTimer()
for b.Loop() {
_ = l.Lex(content)
_ = l.Exec(content)
}
}

Expand All @@ -165,7 +165,7 @@ func BenchmarkLexerAndParser(b *testing.B) {
b.SetBytes(int64(len(content)))
b.ResetTimer()
for b.Loop() {
doc.Tokens = lexerService.Lex(content).Tokens
doc.Tokens = lexerService.Exec(content).Tokens
result := parserService.Parse(doc)
doc.Root = result.Node
}
Expand Down
Loading