Skip to content

Commit

Permalink
Remove double quotation from parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaangandhi committed Oct 9, 2020
1 parent 6e8827f commit 4786efa
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 548 deletions.
1 change: 0 additions & 1 deletion src/prelexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,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 @@ -25,7 +25,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 @@ -265,13 +265,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 @@ -48,20 +48,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[
"WordLiteral", "word"
]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -109,18 +96,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[
[ "WordLiteral", "word" ]
]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -168,16 +144,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[ [ "WordLiteral", "word" ] ]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -225,16 +192,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[ [ "WordLiteral", "word" ] ]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -282,16 +240,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[ [ "WordLiteral", "word" ] ]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -339,16 +288,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[ [ "WordLiteral", "word" ] ]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -396,16 +336,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[ [ "WordLiteral", "word" ] ]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down Expand Up @@ -453,16 +384,7 @@
[
"Word",
"word",
[
[
"WordDoubleQuoted",
[
"Word",
"word",
[ [ "WordLiteral", "word" ] ]
]
]
]
[ [ "WordLiteral", "word" ] ]
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,7 @@
[
"Word",
"<<?",
[
[
"WordDoubleQuoted",
[
"Word",
"<<?",
[ [ "WordLiteral", "<<?" ] ]
]
]
]
[ [ "WordLiteral", "<<?" ] ]
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,58 +36,49 @@
"$(echo foo)",
[
[
"WordDoubleQuoted",
"WordSubshell",
[ "SubShellKindParentheses" ],
[
"Word",
"$(echo foo)",
"Program_LineBreak_CompleteCommands_LineBreak",
[ "LineBreak_Empty" ],
[
"CompleteCommands_CompleteCommand",
[
"WordSubshell",
[ "SubShellKindParentheses" ],
"CompleteCommand_CList",
[
"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 @@ -96,11 +87,11 @@
]
]
]
],
[ "LineBreak_Empty" ]
]
]
]
]
],
[ "LineBreak_Empty" ]
]
]
]
Expand Down
Loading

0 comments on commit 4786efa

Please sign in to comment.