Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove double quotation from parameter
Browse files Browse the repository at this point in the history
ishaangandhi authored and Niols committed May 12, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent d678f96 commit 0dbb64c
Showing 7 changed files with 75 additions and 337 deletions.
1 change: 0 additions & 1 deletion src/prelexer.mll
Original file line number Diff line number Diff line change
@@ -482,7 +482,6 @@ rule token current = parse
| "}" {
debug ~rule:"parameter-closing-brace" lexbuf current;
if under_braces current then
let current = pop_quotation OpeningBrace current in
let _ = debug ~rule:"parameter-closing-brace-after-pop" lexbuf current in
return lexbuf current []
else
4 changes: 1 addition & 3 deletions src/prelexerState.ml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ type atom =
| QuotingMark of quote_kind
| AssignmentMark

and quote_kind = SingleQuote | DoubleQuote | OpeningBrace
and quote_kind = SingleQuote | DoubleQuote

module AtomBuffer : sig
type t
@@ -267,13 +267,11 @@ let pop_quotation k b =
match k with
| SingleQuote -> WordSingleQuoted word
| DoubleQuote -> WordDoubleQuoted word
| OpeningBrace -> WordDoubleQuoted word
in
let squote =
match k with
| SingleQuote -> "'" ^ squote ^ "'"
| DoubleQuote -> "\"" ^ squote ^ "\""
| OpeningBrace -> squote
in
let quote = WordComponent (squote, quoted_word) in
let buffer = AtomBuffer.make (quote :: buffer) in
Original file line number Diff line number Diff line change
@@ -105,21 +105,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -169,21 +155,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -233,21 +205,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -297,21 +255,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -361,21 +305,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -425,21 +355,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -489,21 +405,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
@@ -553,21 +455,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Original file line number Diff line number Diff line change
@@ -46,21 +46,7 @@
[
"Word",
"<<?",
[
[
"WordDoubleQuoted",
[
"Word",
"<<?",
[
[
"WordLiteral",
"<<?"
]
]
]
]
]
[ [ "WordLiteral", "<<?" ] ]
]
]
]
Original file line number Diff line number Diff line change
@@ -38,62 +38,49 @@
"$(echo foo)",
[
[
"WordDoubleQuoted",
"WordSubshell",
[ "SubShellKindParentheses" ],
[
"Word",
"$(echo foo)",
"Program_LineBreak_CompleteCommands_LineBreak",
[ "LineBreak_Empty" ],
[
"CompleteCommands_CompleteCommand",
[
"WordSubshell",
"CompleteCommand_CList",
[
"SubShellKindParentheses"
],
[
"Program_LineBreak_CompleteCommands_LineBreak",
[
"LineBreak_Empty"
],
"CList_AndOr",
[
"CompleteCommands_CompleteCommand",
"AndOr_Pipeline",
[
"CompleteCommand_CList",
"Pipeline_PipeSequence",
[
"CList_AndOr",
"PipeSequence_Command",
[
"AndOr_Pipeline",
"Command_SimpleCommand",
[
"Pipeline_PipeSequence",
"SimpleCommand_CmdName_CmdSuffix",
[
"PipeSequence_Command",
"CmdName_Word",
[
"Command_SimpleCommand",
"Word",
"echo",
[
"SimpleCommand_CmdName_CmdSuffix",
[
"CmdName_Word",
[
"Word",
"echo",
[
[
"WordName",
"echo"
]
]
]
],
"WordName",
"echo"
]
]
]
],
[
"CmdSuffix_Word",
[
"Word",
"foo",
[
[
"CmdSuffix_Word",
[
"Word",
"foo",
[
[
"WordName",
"foo"
]
]
]
"WordName",
"foo"
]
]
]
@@ -102,13 +89,11 @@
]
]
]
],
[
"LineBreak_Empty"
]
]
]
]
],
[ "LineBreak_Empty" ]
]
]
]

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -483,7 +483,7 @@
"'}'",
[
[
"WordDoubleQuoted",
"WordSingleQuoted",
[
"Word",
"'}'",

0 comments on commit 0dbb64c

Please sign in to comment.