summaryrefslogtreecommitdiff
path: root/tests/lexers/bc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lexers/bc')
-rw-r--r--tests/lexers/bc/example.txt570
1 files changed, 570 insertions, 0 deletions
diff --git a/tests/lexers/bc/example.txt b/tests/lexers/bc/example.txt
new file mode 100644
index 00000000..37a989b2
--- /dev/null
+++ b/tests/lexers/bc/example.txt
@@ -0,0 +1,570 @@
+---input---
+/*
+ * Calculate the Greatest Common Divisor of a and b.
+ */
+define gcd(a, b) {
+ auto tmp;
+
+ /*
+ * Euclidean algorithm
+ */
+ while (b != 0) {
+ tmp = a % b;
+ a = b;
+ b = tmp;
+ }
+ return a;
+}
+"gcd(225, 150) = " ; gcd(225, 150)
+
+/* assign operators */
+a = 10
+a += 1
+a++
+++a
+a--
+--a
+a += 5
+a -= 5
+a *= 2
+a /= 3
+a ^= 2
+a %= 2
+
+/* comparison */
+if (a > 2) {
+}
+if (a >= 2) {
+}
+if (a == 2) {
+}
+if (a != 2) {
+}
+if (a <= 2) {
+}
+if (a < 2) {
+}
+
+a /* /*/ * 2 /* == a * 2 */
+a //* /*/ 1.5 /* == a / 1.5 */
+a /*/*/ * 3 /* == a * 3 */
+a * 3 /**/ * 4 /* == a * 3 * 4 */
+a / 3 //*//*/ .4 /* == a / 3 / 0.4 */
+a / 3 //*//*/ 1.3 /* == a / 3 / 1.4 */
+a / 3 /*//*// 1.3 /* == a / 3 / 1.4 */
+
+---tokens---
+'/*' Comment.Multiline
+'\n ' Comment.Multiline
+'*' Comment.Multiline
+' Calculate the Greatest Common Divisor of a and b.\n ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'define' Keyword
+' ' Text
+'g' Text
+'c' Text
+'d' Text
+'(' Punctuation
+'a' Text
+',' Punctuation
+' ' Text
+'b' Text
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'auto' Keyword
+' ' Text
+'t' Text
+'m' Text
+'p' Text
+';' Punctuation
+'\n' Text
+
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+'\n ' Comment.Multiline
+'*' Comment.Multiline
+' Euclidean algorithm\n ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'while' Keyword
+' ' Text
+'(' Punctuation
+'b' Text
+' ' Text
+'!=' Operator
+' ' Text
+'0' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'t' Text
+'m' Text
+'p' Text
+' ' Text
+'=' Operator
+' ' Text
+'a' Text
+' ' Text
+'%' Operator
+' ' Text
+'b' Text
+';' Punctuation
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'a' Text
+' ' Text
+'=' Operator
+' ' Text
+'b' Text
+';' Punctuation
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'b' Text
+' ' Text
+'=' Operator
+' ' Text
+'t' Text
+'m' Text
+'p' Text
+';' Punctuation
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'}' Punctuation
+'\n' Text
+
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'return' Keyword
+' ' Text
+'a' Text
+';' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'"gcd(225, 150) = "' Literal.String
+' ' Text
+';' Punctuation
+' ' Text
+'g' Text
+'c' Text
+'d' Text
+'(' Punctuation
+'225' Literal.Number
+',' Punctuation
+' ' Text
+'150' Literal.Number
+')' Punctuation
+'\n' Text
+
+'\n' Text
+
+'/*' Comment.Multiline
+' assign operators ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'=' Operator
+' ' Text
+'10' Literal.Number
+'\n' Text
+
+'a' Text
+' ' Text
+'+=' Operator
+' ' Text
+'1' Literal.Number
+'\n' Text
+
+'a' Text
+'++' Operator
+'\n' Text
+
+'++' Operator
+'a' Text
+'\n' Text
+
+'a' Text
+'--' Operator
+'\n' Text
+
+'--' Operator
+'a' Text
+'\n' Text
+
+'a' Text
+' ' Text
+'+=' Operator
+' ' Text
+'5' Literal.Number
+'\n' Text
+
+'a' Text
+' ' Text
+'-=' Operator
+' ' Text
+'5' Literal.Number
+'\n' Text
+
+'a' Text
+' ' Text
+'*=' Operator
+' ' Text
+'2' Literal.Number
+'\n' Text
+
+'a' Text
+' ' Text
+'/=' Operator
+' ' Text
+'3' Literal.Number
+'\n' Text
+
+'a' Text
+' ' Text
+'^=' Operator
+' ' Text
+'2' Literal.Number
+'\n' Text
+
+'a' Text
+' ' Text
+'%=' Operator
+' ' Text
+'2' Literal.Number
+'\n' Text
+
+'\n' Text
+
+'/*' Comment.Multiline
+' comparison ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'if' Keyword
+' ' Text
+'(' Punctuation
+'a' Text
+' ' Text
+'>' Operator
+' ' Text
+'2' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'if' Keyword
+' ' Text
+'(' Punctuation
+'a' Text
+' ' Text
+'>=' Operator
+' ' Text
+'2' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'if' Keyword
+' ' Text
+'(' Punctuation
+'a' Text
+' ' Text
+'==' Operator
+' ' Text
+'2' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'if' Keyword
+' ' Text
+'(' Punctuation
+'a' Text
+' ' Text
+'!=' Operator
+' ' Text
+'2' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'if' Keyword
+' ' Text
+'(' Punctuation
+'a' Text
+' ' Text
+'<=' Operator
+' ' Text
+'2' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'if' Keyword
+' ' Text
+'(' Punctuation
+'a' Text
+' ' Text
+'<' Operator
+' ' Text
+'2' Literal.Number
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'\n' Text
+
+'a' Text
+' ' Text
+'/*' Comment.Multiline
+' ' Comment.Multiline
+'/' Comment.Multiline
+'*/' Comment.Multiline
+' ' Text
+'*' Operator
+' ' Text
+'2' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'*' Comment.Multiline
+' 2 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'/' Operator
+'/*' Comment.Multiline
+' ' Comment.Multiline
+'/' Comment.Multiline
+'*/' Comment.Multiline
+' ' Text
+'1.5' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'/' Comment.Multiline
+' 1.5 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'/*' Comment.Multiline
+'/' Comment.Multiline
+'*/' Comment.Multiline
+' ' Text
+'*' Operator
+' ' Text
+'3' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'*' Comment.Multiline
+' 3 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'*' Operator
+' ' Text
+'3' Literal.Number
+' ' Text
+'/*' Comment.Multiline
+'*/' Comment.Multiline
+' ' Text
+'*' Operator
+' ' Text
+'4' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'*' Comment.Multiline
+' 3 ' Comment.Multiline
+'*' Comment.Multiline
+' 4 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'/' Operator
+' ' Text
+'3' Literal.Number
+' ' Text
+'/' Operator
+'/*' Comment.Multiline
+'/' Comment.Multiline
+'/' Comment.Multiline
+'*/' Comment.Multiline
+' ' Text
+'.4' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'/' Comment.Multiline
+' 3 ' Comment.Multiline
+'/' Comment.Multiline
+' 0.4 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'/' Operator
+' ' Text
+'3' Literal.Number
+' ' Text
+'/' Operator
+'/*' Comment.Multiline
+'/' Comment.Multiline
+'/' Comment.Multiline
+'*/' Comment.Multiline
+' ' Text
+'1.3' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'/' Comment.Multiline
+' 3 ' Comment.Multiline
+'/' Comment.Multiline
+' 1.4 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text
+
+'a' Text
+' ' Text
+'/' Operator
+' ' Text
+'3' Literal.Number
+' ' Text
+'/*' Comment.Multiline
+'/' Comment.Multiline
+'/' Comment.Multiline
+'*/' Comment.Multiline
+'/' Operator
+' ' Text
+'1.3' Literal.Number
+' ' Text
+' ' Text
+' ' Text
+'/*' Comment.Multiline
+' == a ' Comment.Multiline
+'/' Comment.Multiline
+' 3 ' Comment.Multiline
+'/' Comment.Multiline
+' 1.4 ' Comment.Multiline
+'*/' Comment.Multiline
+'\n' Text