Skip to content

Commit

Permalink
add character extension
Browse files Browse the repository at this point in the history
  • Loading branch information
6cdh committed Aug 2, 2023
1 parent 0958c99 commit da7c5b2
Show file tree
Hide file tree
Showing 4 changed files with 1,870 additions and 1,794 deletions.
18 changes: 18 additions & 0 deletions corpus/ext.scm
Expand Up @@ -22,3 +22,21 @@ keyword
(program
(keyword)
(keyword))

===
character
===

#\bel
#\ls
#\nel
#\rubout
#\vt

---
(program
(character)
(character)
(character)
(character)
(character))
10 changes: 9 additions & 1 deletion grammar.js
Expand Up @@ -113,6 +113,13 @@ const r7rs = {
"|")
};

const extension = {
character:
seq(
"#\\",
choice("bel", "ls", "nel", "rubout", "vt")),
};

const hidden_node = {
symbol:
token(
Expand Down Expand Up @@ -205,7 +212,8 @@ module.exports = grammar({
choice(
r5rs.character,
r6rs.character,
r7rs.character)),
r7rs.character,
extension.character)),

string: $ =>
seq(
Expand Down
34 changes: 34 additions & 0 deletions src/grammar.json
Expand Up @@ -12064,6 +12064,40 @@
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "#\\"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "bel"
},
{
"type": "STRING",
"value": "ls"
},
{
"type": "STRING",
"value": "nel"
},
{
"type": "STRING",
"value": "rubout"
},
{
"type": "STRING",
"value": "vt"
}
]
}
]
}
]
}
Expand Down

0 comments on commit da7c5b2

Please sign in to comment.