Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 7, 2024
1 parent 49f7a5b commit 19842cc
Show file tree
Hide file tree
Showing 3 changed files with 3,435 additions and 3,388 deletions.
41 changes: 21 additions & 20 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,26 +298,27 @@ module.exports = grammar({
recipe_line_prefix: (_) => choice("@-", "-@", "@", "-"),

shebang: ($) =>
prec(
4,
seq(
// token.immediate(
// /\s*#!.*/,
// choice(
// prec(
// 2,
// token.immediate(
// $.shebang_language,
// // seq(/\S*bin\S*[/ ]/, $.shebang_language, optional(/.+/)),
// ),
// ),
// // /.*/,
// ),
// ),
/#!.*/,
$._newline,
),
),
prec.left(10, seq(token.immediate(/#!/, /.*/), optional($._newline))),
// prec(
// 4,
// seq(
// // token.immediate(
// // /\s*#!.*/,
// // choice(
// // prec(
// // 2,
// // token.immediate(
// // $.shebang_language,
// // // seq(/\S*bin\S*[/ ]/, $.shebang_language, optional(/.+/)),
// // ),
// // ),
// // // /.*/,
// // ),
// // ),
// /#!.*/,
// $._newline,
// ),
// ),

shebang_language: ($) => /.+/,
///\S+/,
Expand Down
23 changes: 17 additions & 6 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1252,18 +1252,29 @@
]
},
"shebang": {
"type": "PREC",
"value": 4,
"type": "PREC_LEFT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "#!.*"
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "#!"
}
},
{
"type": "SYMBOL",
"name": "_newline"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_newline"
},
{
"type": "BLANK"
}
]
}
]
}
Expand Down
Loading

0 comments on commit 19842cc

Please sign in to comment.