Skip to content

Commit

Permalink
Merge #332
Browse files Browse the repository at this point in the history
332: [WIP] Add multiline comments to Pest's PEG format r=dragostis a=felix91gr

Implementation of #330. At least, that's what I think.

Probably needs tests. How do I make one, or update the existing ones?

And how can I test it manually?

Thanks <3

Co-authored-by: Félix Fischer <[email protected]>
Co-authored-by: Félix Fischer <[email protected]>
  • Loading branch information
3 people committed Nov 6, 2018
2 parents dba2949 + b312f6f commit dece2c9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 105 deletions.
20 changes: 20 additions & 0 deletions derive/tests/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,23 @@ SYMBOL = { "shadows builtin" }

WHITESPACE = _{ " " }
COMMENT = _{ "$"+ }

// Line comment

/* 1-line multiline comment */

/*
N-line multiline comment
*/

/*
// Line comment inside multiline

/*
(Multiline inside) multiline
*/

Invalid segment of grammar below (repeated rule)

WHITESPACE = _{ "hi" }
*/
3 changes: 2 additions & 1 deletion meta/src/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ range_operator = { ".." }

newline = _{ "\n" | "\r\n" }
WHITESPACE = _{ " " | "\t" | newline }
COMMENT = _{ "//" ~ (!newline ~ ANY)* }
block_comment = _{ "/*" ~ (block_comment | !"*/" ~ ANY)* ~ "*/" }
COMMENT = _{ block_comment | ("//" ~ (!newline ~ ANY)*) }
60 changes: 0 additions & 60 deletions vm/tests/grammar.pest

This file was deleted.

1 change: 1 addition & 0 deletions vm/tests/grammar.pest
18 changes: 0 additions & 18 deletions vm/tests/lists.pest

This file was deleted.

1 change: 1 addition & 0 deletions vm/tests/lists.pest
26 changes: 0 additions & 26 deletions vm/tests/reporting.pest

This file was deleted.

1 change: 1 addition & 0 deletions vm/tests/reporting.pest

0 comments on commit dece2c9

Please sign in to comment.