diff options
author | Andr?s Carrasco <andres.c.k@gmail.com> | 2018-04-17 19:11:12 +0200 |
---|---|---|
committer | Andr?s Carrasco <andres.c.k@gmail.com> | 2018-04-17 19:11:12 +0200 |
commit | e3872ea8f65ac2c3c40046a7a3acf4f0541f0e56 (patch) | |
tree | d348507792d7b92129378e6f6cb0b2cb66dbb5d7 /tests | |
parent | 0db8e281af377923115b894703b2b8beb8f1e9d5 (diff) | |
download | pygments-e3872ea8f65ac2c3c40046a7a3acf4f0541f0e56.tar.gz |
Add a lexer for the Boa Domain-Specific Langauge.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examplefiles/example.boa | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/examplefiles/example.boa b/tests/examplefiles/example.boa new file mode 100644 index 00000000..a18f1626 --- /dev/null +++ b/tests/examplefiles/example.boa @@ -0,0 +1,18 @@ +# Computes Number of Public Methods (NPM) for each project, per-type
+# Output is: NPM[ProjectID][TypeName] = NPM value
+p: Project = input;
+NPM: output sum[string][string] of int;
+
+visit(p, visitor {
+ # only look at the latest snapshot
+ before n: CodeRepository -> {
+ snapshot := getsnapshot(n);
+ foreach (i: int; def(snapshot[i]))
+ visit(snapshot[i]);
+ stop;
+ }
+ before node: Declaration ->
+ if (node.kind == TypeKind.CLASS)
+ foreach (i: int; has_modifier_public(node.methods[i]))
+ NPM[p.id][node.name] << 1;
+});
|