Avoid token `cl:loop`

pull/70/head
Stephan Seitz 2021-04-17 21:44:04 +07:00
parent b83073d7a1
commit cf58267ba5
5 changed files with 63448 additions and 59154 deletions

@ -124,7 +124,7 @@ module.exports = grammar(clojure, {
loop_macro: $ =>
seq(field('open', "("),
optional($._gap),
choice('loop', 'cl:loop'),
choice(seq(optional(seq('cl', ':')), 'loop')),
repeat(choice($.loop_clause, $._gap)),
field('close', ")")),

@ -465,7 +465,7 @@
},
{
"type": "SYMBOL",
"name": "sym_lit"
"name": "kwd_symbol"
}
]
}
@ -2316,12 +2316,34 @@
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "loop"
},
{
"type": "STRING",
"value": "cl:loop"
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "cl"
},
{
"type": "STRING",
"value": ":"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "loop"
}
]
}
]
},
@ -2568,6 +2590,39 @@
]
}
},
"kwd_symbol": {
"type": "SEQ",
"members": [
{
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "[^:\\f\\n\\r\\t ()\\[\\]{}\"@^;`\\\\,#'\\u000B\\u001C\\u001D\\u001E\\u001F\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2008\\u2009\\u200a\\u205f\\u3000]"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[^:\\f\\n\\r\\t ()\\[\\]{}\"@^;`\\\\,#'\\u000B\\u001C\\u001D\\u001E\\u001F\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2008\\u2009\\u200a\\u205f\\u3000]"
},
{
"type": "PATTERN",
"value": "[#']"
}
]
}
}
]
}
}
]
},
"include_reader_macro": {
"type": "SEQ",
"members": [

@ -1738,12 +1738,17 @@
"required": true,
"types": [
{
"type": "sym_lit",
"type": "kwd_symbol",
"named": true
}
]
}
},
{
"type": "kwd_symbol",
"named": true,
"fields": {}
},
{
"type": "list_lit",
"named": true,
@ -4436,7 +4441,7 @@
"named": false
},
{
"type": "cl:loop",
"type": "cl",
"named": false
},
{

File diff suppressed because it is too large Load Diff

@ -137,7 +137,7 @@ Defun header
(defun_keyword)
(sym_lit)
(kwd_lit
(sym_lit))
(kwd_symbol))
(list_lit
(sym_lit)
(sym_lit)
@ -552,9 +552,9 @@ Keywords
(source
(kwd_lit
(sym_lit))
(kwd_symbol))
(kwd_lit
(sym_lit)))
(kwd_symbol)))
================================================================================
Functions with numbers (TODO!!!)
@ -734,7 +734,7 @@ Multiple gaps in Loop
(sym_lit)
(sym_lit)))
(kwd_lit
(sym_lit))
(kwd_symbol))
(list_lit
(sym_lit)
(sym_lit)
@ -743,7 +743,7 @@ Multiple gaps in Loop
(sym_lit)
(sym_lit))
(kwd_lit
(sym_lit))
(kwd_symbol))
(sym_lit)))))))))))))
================================================================================
@ -793,3 +793,171 @@ Num Literals (TODO)
#C(0D0 0D0) #C(0D0 -0D0) #C(-0D0 0D0) #C(-0D0 -0D0)
#C(0L0 0L0) #C(0L0 -0L0) #C(-0L0 0L0) #C(-0L0 -0L0)))
--------------------------------------------------------------------------------
(source
(list_lit
(sym_lit)
(sym_lit)
(list_lit)
(quoting_lit
(list_lit
(sym_lit)
(num_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(num_lit)
(sym_lit)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'S'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)))
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'S'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit))
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'S'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'S'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'F'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'F'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'F'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'F'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'D'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'D'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'D'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'D'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'L'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'L'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'L'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR)
(complex_num_lit
(num_lit)
(ERROR
(UNEXPECTED 'L'))
(num_lit)
(MISSING "))
(num_lit)
(sym_lit)
(ERROR))