Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove double quotation from parameter #122

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/prelexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/prelexerState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -169,21 +155,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -233,21 +205,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -297,21 +255,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -361,21 +305,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -425,21 +355,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -489,21 +405,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -553,21 +455,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral",
"word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,7 @@
[
"Word",
"<<?",
[
[
"WordDoubleQuoted",
[
"Word",
"<<?",
[
[
"WordLiteral",
"<<?"
]
]
]
]
]
[ [ "WordLiteral", "<<?" ] ]
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
]
]
Expand All @@ -102,13 +89,11 @@
]
]
]
],
[
"LineBreak_Empty"
]
]
]
]
],
[ "LineBreak_Empty" ]
]
]
]
Expand Down
Loading