Skip to content

Commit 9be92cf

Browse files
committed
update README to reflect xtext2ts grammar pipeline
- Replace VSCode extension references with upstream Xtext grammar - Fix incorrect syntax details (keywords, time units, booleans, comments) - Document xtext2ts workflow and automated grammar sync
1 parent 975eb87 commit 9be92cf

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,17 @@ require("lf").setup({
303303

304304
### Lingua Franca Keywords
305305
- **Core**: `reactor`, `input`, `output`, `action`, `state`, `timer`, `reaction`, `method`, `preamble`
306-
- **Modifiers**: `public`, `private`, `widthof`, `mutable`
307-
- **Control flow**: `if`, `else`, `for`, `while`
308-
- **Temporal**: `startup`, `shutdown`, `after`, `physical`, `logical`
306+
- **Modifiers**: `main`, `federated`, `realtime`, `mutable`, `const`, `logical`, `physical`
307+
- **Modes**: `mode`, `initial`, `reset`, `history`
308+
- **Other**: `after`, `deadline`, `new`, `at`, `widthof`, `startup`, `shutdown`
309309

310310
### Literals & Operators
311-
- **Time units**: `nsec`, `msec`, `sec`, `min`, `hour`, `day`, `week`
312-
- **Numbers**: Integers, floats, scientific notation
313-
- **Strings**: Single, double, and triple-quoted with escape sequences
314-
- **Operators**: `->`, `~>`, `::`, arithmetic and logical operators
315-
- **Booleans**: `true`, `false`, `True`, `False`
311+
- **Time values**: `100 msec`, `1 sec`, `forever`, `never`
312+
- **Time units**: `nsec`, `usec`, `msec`, `sec`, `min`, `hour`, `day`, `week` (and abbreviations like `ns`, `us`, `ms`, `s`, `m`, `h`, `d`)
313+
- **Numbers**: Integers, floats
314+
- **Strings**: Double-quoted strings, char literals
315+
- **Operators**: `->` (connections), `~>` (physical connections)
316+
- **Booleans**: `true`, `false`
316317

317318
### Embedded Languages
318319

@@ -323,9 +324,8 @@ Code within `{= =}` delimiters gets full syntax highlighting:
323324
- **Rust**: Ownership keywords, macros, lifetimes
324325

325326
### Comments
326-
- Line comments: `//` and `#`
327+
- Line comments: `//`
327328
- Block comments: `/* */`
328-
- TODO/FIXME highlighting
329329

330330
## 📖 Documentation
331331

@@ -346,9 +346,11 @@ Topics include:
346346
## 🤝 Contributing
347347

348348
Contributions welcome! This plugin combines:
349-
- Syntax grammar from [VSCode Lingua Franca extension](https://github.com/lf-lang/vscode-lingua-franca)
349+
- Tree-sitter grammar auto-generated from the official [Lingua Franca Xtext grammar](https://github.com/lf-lang/lingua-franca) via `xtext2ts`
350350
- LSP server from [Lingua Franca compiler](https://github.com/lf-lang/lingua-franca)
351351

352+
A weekly GitHub Action checks for upstream grammar changes, regenerates the tree-sitter grammar, validates against all upstream test files, and opens a PR automatically.
353+
352354
### Reporting Issues
353355

354356
If you encounter:
@@ -371,6 +373,12 @@ Please open an issue with:
371373
git clone https://github.com/remifan/lf.nvim.git
372374
cd lf.nvim
373375

376+
# Regenerate tree-sitter grammar from upstream Xtext
377+
python -m xtext2ts \
378+
--xtext /path/to/LinguaFranca.xtext \
379+
--output tree-sitter-lf/grammar.js
380+
cd tree-sitter-lf && tree-sitter generate
381+
374382
# Test locally (syntax only)
375383
nvim -u NONE -c "set rtp+=." test.lf
376384

@@ -419,6 +427,6 @@ MIT License - see [LICENSE](LICENSE) file for details.
419427

420428
## 🙏 Acknowledgments
421429

422-
- Syntax grammar based on the official [VSCode Lingua Franca extension](https://github.com/lf-lang/vscode-lingua-franca)
430+
- Tree-sitter grammar generated from the official [Lingua Franca Xtext grammar](https://github.com/lf-lang/lingua-franca)
423431
- LSP server from the [Lingua Franca compiler project](https://github.com/lf-lang/lingua-franca)
424432
- Built for the [Lingua Franca](https://www.lf-lang.org/) community

0 commit comments

Comments
 (0)