summaryrefslogtreecommitdiff
path: root/tests/examplefiles/example.boa
diff options
context:
space:
mode:
authorAnteru <bitbucket@ca.sh13.net>2019-05-21 16:32:04 +0000
committerAnteru <bitbucket@ca.sh13.net>2019-05-21 16:32:04 +0000
commit9c84bc6450663888e243268621dcf71eab18ed11 (patch)
tree15231faf42954c633413b5c06369da6b05949ed7 /tests/examplefiles/example.boa
parentc0db1e260ea7e399a1f34bc9966914298e1b6b17 (diff)
parent8202e648945351366bd0c465d72953fae40f4783 (diff)
downloadpygments-9c84bc6450663888e243268621dcf71eab18ed11.tar.gz
Merged in lucatorella/pygments-main (pull request #813)
Add support for @import keyword in Objective-C
Diffstat (limited to 'tests/examplefiles/example.boa')
-rw-r--r--tests/examplefiles/example.boa18
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;
+});