#parser #incremental #nasl

tree-sitter-nasl

nasl grammar for the tree-sitter parsing library

9 releases

0.1.0 Jul 26, 2022
0.0.8 Jul 24, 2022
0.0.3 Jun 30, 2022

#340 in Text editors

MIT license

665KB
26K SLoC

C 25K SLoC JavaScript 613 SLoC // 0.0% comments Scheme 46 SLoC Rust 34 SLoC // 0.4% comments

tree-sitter-nasl

NASL grammar for tree-sitter. Mostly pirated from tree-sitter-c.

It is in a very early state.

TODO

  • what is send_socket () x 100?
  • are IPv4 own type e.g. ip = 192.168.1.244 without "'?

lib.rs:

This crate provides nasl language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_nasl::language()).expect("Error loading nasl grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~71K SLoC