summaryrefslogtreecommitdiff
path: root/tests/examplefiles/rita/example.rita
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2021-12-28 16:17:08 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2021-12-28 16:17:08 +0100
commita7094139d7734beebfaeae9c3da4e26aa26ccb22 (patch)
tree1a26163310186ff7e3994006027ecc93513bdaa1 /tests/examplefiles/rita/example.rita
parent42b61e170ec321ad3487a3865e19cbc3ba757691 (diff)
downloadpygments-git-a7094139d7734beebfaeae9c3da4e26aa26ccb22.tar.gz
Various small fixups for the Rita lexer.
Diffstat (limited to 'tests/examplefiles/rita/example.rita')
-rw-r--r--tests/examplefiles/rita/example.rita12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/examplefiles/rita/example.rita b/tests/examplefiles/rita/example.rita
new file mode 100644
index 00000000..fd6e7ef5
--- /dev/null
+++ b/tests/examplefiles/rita/example.rita
@@ -0,0 +1,12 @@
+@alias IN_LIST IL
+
+!CONFIG("case_sensitive", "N")
+
+cars = LOAD("examples/cars.txt") # Load items from file
+colors = {"red", "green", "blue", "white", "black"} # Declare items inline
+
+{IL(colors), WORD("car")} -> MARK("CAR_COLOR") # If first token is in list `colors` and second one is word `car`, label it
+
+{IL(cars), WORD+} -> MARK("CAR_MODEL") # If first token is in list `cars` and follows by 1..N words, label it
+
+{ENTITY("PERSON"), LEMMA("like"), WORD} -> MARK("LIKED_ACTION") # If first token is Person, followed by any word which has lemma `like`, label it