112 commits

Author SHA1 Message Date
David A. Wheeler
cab19bc813 sweet.g: Simplify comment definition and supporting definitions generally
- This simplifies a number of definitions.
  - This removes support for "#!" followed by newline, but there
    was no real pressing need for it since #|...|# works portably.
2013-08-05 18:10:59 -04:00
David A. Wheeler
3703cd5a59 Fix subtle bug in <* #;+whitespace sequence implementation. 2013-07-30 23:45:20 -04:00
David A. Wheeler
b9c48263e5 Modify sweet.g grammar with "ignorable" - simplifies and bugfixes post_period
- Create a new "ignorable" production that combines
    scomment and DATUM_COMMENTW handling, for use in rules that
    process lines after the initial head expression.
  - This simplifies rules like "rest".
  - This fixes a problem with post_period, which previously
    didn't allow DATUM_COMMENTW in some later positions.
    Now it can handle stuff like:
    a7 b7 #; ignore1 . #; ignore2 c7 #; ignore3
2013-07-27 19:53:02 -04:00
David A. Wheeler
269ace6f79 Modify ANTLR grammar so "#; space+tab" works in line.
- The way the grammar works, DATUM_COMMENTW can only be generated
    outside (...), but that means we must directly handle it in a few
    grammar rules (e.g., "rest" and "post_period").
2013-07-24 14:22:05 -04:00
David A. Wheeler
7407681397 Add more tests for sweet.g 2013-07-14 19:38:15 -04:00
David A. Wheeler
41064fde08 Add more empty tests 2013-07-14 13:45:25 -04:00
David A. Wheeler
c5abe4f943 sweet.g: First cut at implementing #;+whitespace at beginning of it expression 2013-07-13 12:23:37 -04:00
David A. Wheeler
18211cbadc sweet.g: First mods to begin supporting #; and empty return values 2013-07-13 09:49:30 -04:00
David A. Wheeler
da014051e6 Create DATUM_COMMENTW to model "#;" followed by whitespace 2013-07-11 21:38:30 -04:00
David A. Wheeler
4cdfb3c8e4 Remove support for "$ ." sequence as special meaning 2013-03-21 20:24:10 -04:00
David A. Wheeler
bf72225600 More tests for ANTLR implementation 2013-03-19 00:05:30 -04:00
David A. Wheeler
3c74361e01 sweet.g: Change BNF to address scomment after ".", using new production
- This version creates a whole new production to deal with
    the rules after ".".  This should make the head and rest
    production handling of "." more consistent.
2013-03-18 23:57:50 -04:00
David A. Wheeler
0e614e3c36 output/input.txt: Test "a . $ b" 2013-03-18 23:29:13 -04:00
David A. Wheeler
1afc1fd840 Add grammar test case "a b . $ c d" => "(a b c d)" for ". $" case. 2013-03-18 23:07:29 -04:00
David A. Wheeler
6f127f6cbe output/correct.txt + output/input.txt: Fix tests 2013-03-18 12:07:42 -04:00
David A. Wheeler
f609ee9aae sweet.g: Allow collecting list after "." in "rest", and test it. 2013-03-13 19:10:28 -04:00
David A. Wheeler
5cf5748fc0 sweet.g: Revert "Beni-lite" experimental implementation
- Revert compromise "Beni-lite" experimental implementation, which
    allowed partial dedents to close "$" but only when "$" was at the
    end of the line.
  - Clearly forbid "$" at the end of the line.  This makes it clear that
    they are forbidden.  This will also make it easier to add Beni-lite
    or the full Beni formulation later, since these are specifically
    not allowed in the current formulation.
2013-02-26 10:16:53 -08:00
David A. Wheeler
6cc8b1b01e sweet.g: Experiment - support partial-dedent (re-indent) for $ line ending 2013-02-23 11:00:07 -05:00
David A. Wheeler
0c09710a9e sweet.g: Allow "$" at end of line 2013-02-21 00:08:03 -05:00
David A. Wheeler
4fe3b2940a Add support for solo "." on line for improper list 2013-01-31 23:06:40 -05:00
David A. Wheeler
35b86934d3 sweet.g: Add support for abbreviation+EOL+indent 2013-01-31 17:36:10 -05:00
David A. Wheeler
3e9c657e83 Fix sublist-of-singleton-list case (e.g., "car $ gettimeofday()")
- The BNF had a subtle bug that hit when the right-hand-side
    was a singleton list. When given:
    car $ gettimeofday()
    It incorrectly gave:
    (car gettimeofday)
    But it was supposed to give:
    (car (gettimeofday))
    The problem was an excess "monify" in the spec, now fixed.
2013-01-28 21:01:35 -05:00
David A. Wheeler
0c5c49460a Add another sweet.g test 2013-01-26 15:10:31 -05:00
David A. Wheeler
98a3712f91 sweet.g: Move Lisp/Scheme basic procedures into sweet.g
- This move makes it easier to see "everything in one place", simplifying
    installation and use by others.
2013-01-24 18:09:07 -05:00
David A. Wheeler
962c482ecc Add more sweet.g for initial "\\" 2013-01-24 17:55:45 -05:00
David A. Wheeler
eda5ddfb55 More sweet.g tests 2013-01-23 08:40:35 -05:00
David A. Wheeler
7fc1b9ce66 Add more restart list tests for sweet.g 2013-01-22 19:46:25 -05:00
David A. Wheeler
5aff4b3984 sweet.g: Change FF/VT semantics + various cleanups
- Now FF/VT must be on their own line, and they will terminate
    any open it-expression, per a recommendation by John Cowan on the
    readable-discuss mailing list dated Tue, 22 Jan 2013 11:37:08 -0500.
  - A few other cleanups related to end-of-line to clarify things
2013-01-22 19:11:19 -05:00
David A. Wheeler
280fd80122 sweet.g, etc.: Clean up code 2013-01-22 07:08:18 -05:00
David A. Wheeler
cd9f58c64d output/scheme/Pair.java: Remove unused procedure 2013-01-22 06:53:11 -05:00
David A. Wheeler
b73e648d89 sweet.g: Implement resetting indent stack for restart 2013-01-21 19:25:54 -05:00
David A. Wheeler
2e2b194704 Add output/unsweeten-bnf testing command (it's a filter) 2013-01-21 17:49:27 -05:00
David A. Wheeler
dee7b911e9 sweet.g: Handle #!sweet EOL EOL case more generally
- This version recurses to t_expr, instead of it_expr.
    This means, for example, that initial indents work "as expected"
    after special comments like #!sweet.
2013-01-21 17:40:30 -05:00
David A. Wheeler
81d801bb61 Accept updated correct values. 2013-01-21 11:33:51 -05:00
David A. Wheeler
e464eb80db sweet.g: Modify special-comment handling
- Now, #!sweet etc. can be followed by blank lines
2013-01-21 11:14:06 -05:00
David A. Wheeler
3b781a295d sweet.g: Fix subtle bug in initial-indent processing 2013-01-21 10:59:50 -05:00
David A. Wheeler
1ecf1f0184 Add another sweet.g test 2013-01-18 17:46:32 -05:00
David A. Wheeler
22a53bf635 sweet.g: Tweak to handle #!... better, and add some tests 2013-01-18 17:44:52 -05:00
David A. Wheeler
71a3143180 sweet.g: Precisely match Scheme numbers in all their baroque glory 2013-01-18 13:18:16 -05:00
David A. Wheeler
ea03b49262 Remove "About to parse" message in sweet.g tests 2013-01-17 22:17:26 -05:00
David A. Wheeler
672fb13895 Unsweeten_ANTLR.java: Remove "About to Parse" message 2013-01-17 22:10:30 -05:00
David A. Wheeler
273241d8b2 sweet.g: Accept ;-comments inside traditional s-expressions 2013-01-17 19:02:51 -05:00
David A. Wheeler
fa38e8ad36 Fix "correct" answres for sweet.g SUBLIST (they were wrong!) 2013-01-16 23:59:01 -05:00
David A. Wheeler
49f65755e1 Add more sweet.g tests 2013-01-16 23:23:50 -05:00
David A. Wheeler
38cd1056f4 Add more sweet.g tests for restart 2013-01-16 19:42:12 -05:00
David A. Wheeler
21455677c0 Add more sweet.g tests for restart lists 2013-01-16 18:34:53 -05:00
David A. Wheeler
6b7b228a1f sweet.g: Fix head production's invocation of restart_list 2013-01-16 13:43:55 -05:00
David A. Wheeler
ea7ca69796 Change to much simpler restart_list productions
- These productions unfortunately cause a massive number of
    warning messages in ANTLR... but they are far simpler.
2013-01-16 13:20:32 -05:00
David A. Wheeler
b5e5f08eb3 sweet.g: Modify restart_list stuff 2013-01-15 21:43:39 -05:00
David A. Wheeler
eb8ebe6be0 sweet.g: Remove "SUBLIST comment_eol" semantics per readable-discuss
- Per discussion on the readable-discuss mailing list, remove
    SUBLIST comment_eol (where SUBLIST is "$").  There's no significant
    use case for it, and the consistency argument for it no longer applies.
    Removing it makes the i_expr production simpler, and it also
    provides an opportunity for some future functionality if one is
    found later.
2013-01-14 18:28:45 -05:00