Merge remote-tracking branch 'origin/master' into sheet
[pspp] / tests / language / lexer / segment.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17 AT_BANNER([syntax segmentation])
18 m4_define([PSPP_CHECK_SEGMENT],
19   [AT_CHECK([segment-test $1 input], [0], [expout])
20    AT_CHECK([segment-test -1 $1 input], [0], [expout])
21    AT_CHECK([segment-test -0 $1 input])
22    AT_CHECK([segment-test -01 $1 input])])
23 \f
24 AT_SETUP([identifiers])
25 AT_KEYWORDS([segment])
26 AT_DATA([input], [dnl
27 a ab abc abcd
28 A AB ABC ABCD
29 aB aBC aBcD
30 $x $y $z
31 grève@<00A0>@Ângstrom@<00A0>@poté
32 #a #b #c ## #d
33 @efg @ @@. @#@ @&t@
34 ## # #12345 #.#
35 f@#_.#6
36 GhIjK
37 .x 1y _z
38 ])
39 AT_DATA([expout], [dnl
40 identifier      a    space
41 identifier      ab    space
42 identifier      abc    space
43 identifier      abcd
44 newline         \n (later)
45
46 identifier      A    space
47 identifier      AB    space
48 identifier      ABC    space
49 identifier      ABCD
50 newline         \n (later)
51
52 identifier      aB    space
53 identifier      aBC    space
54 identifier      aBcD
55 newline         \n (later)
56
57 identifier      $x    space
58 identifier      $y    space
59 identifier      $z
60 newline         \n (later)
61
62 identifier      grève
63 spaces          <U+00A0>
64 identifier      Ângstrom
65 spaces          <U+00A0>
66 identifier      poté
67 newline         \n (later)
68
69 identifier      #a    space
70 identifier      #b    space
71 identifier      #c    space
72 identifier      ##    space
73 identifier      #d
74 newline         \n (later)
75
76 identifier      @efg    space
77 identifier      @    space
78 identifier      @@.    space
79 identifier      @#@    space
80 newline         \n (later)
81
82 identifier      ##    space
83 identifier      #    space
84 identifier      #12345    space
85 identifier      #.#
86 newline         \n (later)
87
88 identifier      f@#\_.#6
89 newline         \n (later)
90
91 identifier      GhIjK
92 newline         \n (later)
93
94 start_command   .
95 identifier      x    space
96 number          1
97 identifier      y    space
98 unexpected_char \_
99 identifier      z
100 newline         \n (later)
101
102 end             <U+0000>
103 ])
104 PSPP_CHECK_SEGMENT([-i])
105 AT_CLEANUP
106 \f
107 AT_SETUP([identifiers that end in '.'])
108 AT_KEYWORDS([segment])
109 AT_DATA([input], [dnl
110 abcd. abcd.
111 ABCD. ABCD.
112 aBcD. aBcD. @&t@
113 $y. $z. あいうえお.
114 #c. #d..
115 @@. @@....
116 #.#.
117 #abcd.
118 .
119 . @&t@
120 LMNOP. @&t@
121 QRSTUV./* end of line comment */
122 qrstuv. /* end of line comment */
123 QrStUv./* end of line comment */ @&t@
124 wxyz./* unterminated end of line comment
125 WXYZ. /* unterminated end of line comment
126 WxYz./* unterminated end of line comment @&t@
127 ])
128 AT_DATA([expout], [dnl
129 identifier      abcd.    space
130 identifier      abcd
131 end_command     .
132 newline         \n (first)
133
134 identifier      ABCD.    space
135 identifier      ABCD
136 end_command     .
137 newline         \n (first)
138
139 identifier      aBcD.    space
140 identifier      aBcD
141 end_command     .    space
142 newline         \n (first)
143
144 identifier      $y.    space
145 identifier      $z.    space
146 identifier      あいうえお
147 end_command     .
148 newline         \n (first)
149
150 identifier      #c.    space
151 identifier      #d.
152 end_command     .
153 newline         \n (first)
154
155 identifier      @@.    space
156 identifier      @@...
157 end_command     .
158 newline         \n (first)
159
160 identifier      #.#
161 end_command     .
162 newline         \n (first)
163
164 identifier      #abcd
165 end_command     .
166 newline         \n (first)
167
168 start_command   .
169 newline         \n (first)
170
171 start_command   .    space
172 newline         \n (first)
173
174 identifier      LMNOP
175 end_command     .    space
176 newline         \n (first)
177
178 identifier      QRSTUV
179 end_command     .
180 comment         /*_end_of_line_comment_*/
181 newline         \n (first)
182
183 identifier      qrstuv
184 end_command     .    space
185 comment         /*_end_of_line_comment_*/
186 newline         \n (first)
187
188 identifier      QrStUv
189 end_command     .
190 comment         /*_end_of_line_comment_*/    space
191 newline         \n (first)
192
193 identifier      wxyz
194 end_command     .
195 comment         /*_unterminated_end_of_line_comment
196 newline         \n (first)
197
198 identifier      WXYZ
199 end_command     .    space
200 comment         /*_unterminated_end_of_line_comment
201 newline         \n (first)
202
203 identifier      WxYz
204 end_command     .
205 comment         /*_unterminated_end_of_line_comment_
206 newline         \n (first)
207
208 end             <U+0000>
209 ])
210 PSPP_CHECK_SEGMENT([-i])
211 AT_CLEANUP
212 \f
213 AT_SETUP([reserved words])
214 AT_KEYWORDS([segment])
215 AT_DATA([input], [dnl
216 and or not eq ge gt le lt ne all by to with
217 AND OR NOT EQ GE GT LE LT NE ALL BY TO WITH
218 andx orx notx eqx gex gtx lex ltx nex allx byx tox withx
219 and. with.
220 ])
221 AT_DATA([expout], [dnl
222 reserved_word   and    space
223 reserved_word   or    space
224 reserved_word   not    space
225 reserved_word   eq    space
226 reserved_word   ge    space
227 reserved_word   gt    space
228 reserved_word   le    space
229 reserved_word   lt    space
230 reserved_word   ne    space
231 reserved_word   all    space
232 reserved_word   by    space
233 reserved_word   to    space
234 reserved_word   with
235 newline         \n (later)
236
237 reserved_word   AND    space
238 reserved_word   OR    space
239 reserved_word   NOT    space
240 reserved_word   EQ    space
241 reserved_word   GE    space
242 reserved_word   GT    space
243 reserved_word   LE    space
244 reserved_word   LT    space
245 reserved_word   NE    space
246 reserved_word   ALL    space
247 reserved_word   BY    space
248 reserved_word   TO    space
249 reserved_word   WITH
250 newline         \n (later)
251
252 identifier      andx    space
253 identifier      orx    space
254 identifier      notx    space
255 identifier      eqx    space
256 identifier      gex    space
257 identifier      gtx    space
258 identifier      lex    space
259 identifier      ltx    space
260 identifier      nex    space
261 identifier      allx    space
262 identifier      byx    space
263 identifier      tox    space
264 identifier      withx
265 newline         \n (later)
266
267 identifier      and.    space
268 reserved_word   with
269 end_command     .
270 newline         \n (first)
271
272 end             <U+0000>
273 ])
274 PSPP_CHECK_SEGMENT([-i])
275 AT_CLEANUP
276 \f
277 AT_SETUP([punctuation])
278 AT_KEYWORDS([segment])
279 AT_DATA([input], [dnl
280 ~ & | = >= > <= < ~= <> ( ) , - + * / [[ ]] **
281 ~&|=>=><=<~=<>(),-+*/[[]]**
282 ])
283 AT_DATA([expout], [dnl
284 punct           ~    space
285 punct           &    space
286 punct           |    space
287 punct           =    space
288 punct           >=    space
289 punct           >    space
290 punct           <=    space
291 punct           <    space
292 punct           ~=    space
293 punct           <>    space
294 punct           (    space
295 punct           )    space
296 punct           ,    space
297 punct           -    space
298 punct           +    space
299 punct           *    space
300 punct           /    space
301 punct           [[    space
302 punct           ]]    space
303 punct           **
304 newline         \n (later)
305
306 punct           ~
307 punct           &
308 punct           |
309 punct           =
310 punct           >=
311 punct           >
312 punct           <=
313 punct           <
314 punct           ~=
315 punct           <>
316 punct           (
317 punct           )
318 punct           ,
319 punct           -
320 punct           +
321 punct           *
322 punct           /
323 punct           [[
324 punct           ]]
325 punct           **
326 newline         \n (later)
327
328 end             <U+0000>
329 ])
330 PSPP_CHECK_SEGMENT([-i])
331 AT_CLEANUP
332 \f
333 AT_SETUP([numbers])
334 AT_KEYWORDS([segment])
335 AT_DATA([input], [dnl
336 0 1 01 001. 1.
337 123. /* comment 1 */ /* comment 2 */
338 .1 0.1 00.1 00.10
339 5e1 6E-1 7e+1 6E+01 6e-03
340 .3E1 .4e-1 .5E+1 .6e+01 .7E-03
341 1.23e1 45.6E-1 78.9e+1 99.9E+01 11.2e-03
342 . 1e e1 1e+ 1e-
343 ])
344 AT_DATA([expout], [dnl
345 number          0    space
346 number          1    space
347 number          01    space
348 number          001.    space
349 number          1
350 end_command     .
351 newline         \n (first)
352
353 number          123
354 end_command     .    space
355 comment         /*_comment_1_*/    space
356 comment         /*_comment_2_*/
357 newline         \n (first)
358
359 start_command   .
360 number          1    space
361 number          0.1    space
362 number          00.1    space
363 number          00.10
364 newline         \n (later)
365
366 number          5e1    space
367 number          6E-1    space
368 number          7e+1    space
369 number          6E+01    space
370 number          6e-03
371 newline         \n (later)
372
373 start_command   .
374 number          3E1    space
375 number          .4e-1    space
376 number          .5E+1    space
377 number          .6e+01    space
378 number          .7E-03
379 newline         \n (later)
380
381 number          1.23e1    space
382 number          45.6E-1    space
383 number          78.9e+1    space
384 number          99.9E+01    space
385 number          11.2e-03
386 newline         \n (later)
387
388 start_command   .    space
389 expected_exponent 1e    space
390 identifier      e1    space
391 expected_exponent 1e+    space
392 expected_exponent 1e-
393 newline         \n (later)
394
395 end             <U+0000>
396 ])
397 PSPP_CHECK_SEGMENT([-i])
398 AT_CLEANUP
399 \f
400 AT_SETUP([strings])
401 AT_KEYWORDS([segment])
402 AT_DATA([input], [dnl
403 'x' "y" 'abc'
404 'Don''t' "Can't" 'Won''t'
405 """quoted""" '"quoted"'
406 '' ""
407 'missing end quote
408 "missing double quote
409 x"4142" X'5152'
410 u'fffd' U"041"
411 + new command
412 + /* comment */ 'string continuation'
413 + /* also a punctuator on blank line
414 - 'new command'
415 ])
416 AT_DATA([expout], [dnl
417 quoted_string   'x'    space
418 quoted_string   "y"    space
419 quoted_string   'abc'
420 newline         \n (later)
421
422 quoted_string   'Don''t'    space
423 quoted_string   "Can't"    space
424 quoted_string   'Won''t'
425 newline         \n (later)
426
427 quoted_string   """quoted"""    space
428 quoted_string   '"quoted"'
429 newline         \n (later)
430
431 quoted_string   ''    space
432 quoted_string   ""
433 newline         \n (later)
434
435 expected_quote  'missing_end_quote
436 newline         \n (later)
437
438 expected_quote  "missing_double_quote
439 newline         \n (later)
440
441 hex_string      x"4142"    space
442 hex_string      X'5152'
443 newline         \n (later)
444
445 unicode_string  u'fffd'    space
446 unicode_string  U"041"
447 newline         \n (later)
448
449 start_command   +    space
450 identifier      new    space
451 identifier      command
452 newline         \n (later)
453
454 punct           +    space
455 comment         /*_comment_*/    space
456 quoted_string   'string_continuation'
457 newline         \n (later)
458
459 punct           +    space
460 comment         /*_also_a_punctuator_on_blank_line
461 newline         \n (later)
462
463 start_command   -    space
464 quoted_string   'new_command'
465 newline         \n (later)
466
467 end             <U+0000>
468 ])
469 PSPP_CHECK_SEGMENT([-i])
470 AT_CLEANUP
471 \f
472 AT_SETUP([@%:@! construct])
473 AT_KEYWORDS([segment])
474 AT_DATA([input], [dnl
475 #! /usr/bin/pspp
476 title my title.
477 #! /usr/bin/pspp
478 ])
479 AT_DATA([expout], [dnl
480 shbang          #!_/usr/bin/pspp
481 newline         \n (first)
482
483 identifier      title    space
484 unquoted_string my_title
485 end_command     .
486 newline         \n (first)
487
488 identifier      #
489 unexpected_char !    space
490 punct           /
491 identifier      usr
492 punct           /
493 identifier      bin
494 punct           /
495 identifier      pspp
496 newline         \n (later)
497
498 end             <U+0000>
499 ])
500 PSPP_CHECK_SEGMENT([-i])
501 AT_CLEANUP
502 \f
503 AT_SETUP([* and COMMENT commands])
504 AT_KEYWORDS([segment])
505 AT_DATA([input], [dnl
506 * Comment commands "don't
507 have to contain valid tokens.
508
509 ** Check ambiguity with ** token.
510 ****************.
511
512 comment keyword works too.
513 COMM also.
514 com is ambiguous with COMPUTE.
515
516    * Comment need not start at left margin.
517
518 * Comment ends with blank line
519
520 next command.
521
522 ])
523 AT_DATA([expout], [dnl
524 comment_command *_Comment_commands_"don't
525 newline         \n (COMMENT)
526
527 comment_command have_to_contain_valid_tokens
528 end_command     .
529 newline         \n (first)
530
531 separate_commands
532 newline         \n (first)
533
534 comment_command **_Check_ambiguity_with_**_token
535 end_command     .
536 newline         \n (first)
537
538 comment_command ****************
539 end_command     .
540 newline         \n (first)
541
542 separate_commands
543 newline         \n (first)
544
545 comment_command comment_keyword_works_too
546 end_command     .
547 newline         \n (first)
548
549 comment_command COMM_also
550 end_command     .
551 newline         \n (first)
552
553 identifier      com    space
554 identifier      is    space
555 identifier      ambiguous    space
556 reserved_word   with    space
557 identifier      COMPUTE
558 end_command     .
559 newline         \n (first)
560
561 separate_commands 
562 newline         \n (first)
563
564 spaces          ___
565 comment_command *_Comment_need_not_start_at_left_margin
566 end_command     .
567 newline         \n (first)
568
569 separate_commands 
570 newline         \n (first)
571
572 comment_command *_Comment_ends_with_blank_line
573 newline         \n (COMMENT)
574
575 separate_commands
576 newline         \n (first)
577
578 identifier      next    space
579 identifier      command
580 end_command     .
581 newline         \n (first)
582
583 separate_commands
584 newline         \n (first)
585
586 end             <U+0000>
587 ])
588 PSPP_CHECK_SEGMENT([-i])
589 AT_CLEANUP
590 \f
591 AT_SETUP([DOCUMENT command])
592 AT_KEYWORDS([segment])
593 AT_DATA([input], [dnl
594 DOCUMENT one line.
595 DOC more
596     than
597         one
598             line.
599 docu
600 first.paragraph
601 isn't parsed as tokens
602
603 second paragraph.
604 ])
605 AT_DATA([expout], [dnl
606 start_document
607 document        DOCUMENT_one_line.
608 end_command     
609 separate_commands
610 newline         \n (first)
611
612 start_document
613 document        DOC_more
614 newline         \n (DOCUMENT)
615
616 document        ____than
617 newline         \n (DOCUMENT)
618
619 document        ________one
620 newline         \n (DOCUMENT)
621
622 document        ____________line.
623 end_command     
624 separate_commands
625 newline         \n (first)
626
627 start_document
628 document        docu
629 newline         \n (DOCUMENT)
630
631 document        first.paragraph
632 newline         \n (DOCUMENT)
633
634 document        isn't_parsed_as_tokens
635 newline         \n (DOCUMENT)
636
637 document
638 newline         \n (DOCUMENT)
639
640 document        second_paragraph.
641 end_command     
642 separate_commands
643 newline         \n (first)
644  
645 end             <U+0000>
646 ])
647 PSPP_CHECK_SEGMENT([-i])
648 AT_CLEANUP
649 \f
650 AT_SETUP([TITLE, SUBTITLE, FILE LABEL commands])
651 AT_KEYWORDS([segment])
652 AT_DATA([input], [dnl
653 title/**/'Quoted string title'.
654 tit /*
655 "Quoted string on second line".
656 sub "Quoted string subtitle"
657  .
658
659 TITL /* Not a */ quoted string title.
660 SUBT Not a quoted string /* subtitle
661
662 FIL label isn't quoted.
663 FILE
664   lab 'is quoted'.
665 FILE /*
666 /**/  lab not quoted here either
667
668 ])
669 AT_DATA([expout], [dnl
670 identifier      title
671 comment         /**/
672 quoted_string   'Quoted_string_title'
673 end_command     .
674 newline         \n (first)
675
676 identifier      tit    space
677 comment         /*
678 newline         \n (later)
679
680 quoted_string   "Quoted_string_on_second_line"
681 end_command     .
682 newline         \n (first)
683
684 identifier      sub    space
685 quoted_string   "Quoted_string_subtitle"
686 newline         \n (later)
687     space
688 end_command     .
689 newline         \n (first)
690
691 separate_commands
692 newline         \n (first)
693
694 identifier      TITL    space
695 unquoted_string /*_Not_a_*/_quoted_string_title
696 end_command     .
697 newline         \n (first)
698
699 identifier      SUBT    space
700 unquoted_string Not_a_quoted_string_/*_subtitle
701 newline         \n (later)
702
703 separate_commands
704 newline         \n (first)
705
706 identifier      FIL    space
707 identifier      label    space
708 unquoted_string isn't_quoted
709 end_command     .
710 newline         \n (first)
711
712 identifier      FILE
713 newline         \n (later)
714
715 spaces          __
716 identifier      lab    space
717 quoted_string   'is_quoted'
718 end_command     .
719 newline         \n (first)
720
721 identifier      FILE    space
722 comment         /*
723 newline         \n (later)
724
725 comment         /**/
726 spaces          __
727 identifier      lab    space
728 unquoted_string not_quoted_here_either
729 newline         \n (later)
730
731 separate_commands
732 newline         \n (first)
733
734 end             <U+0000>
735 ])
736 PSPP_CHECK_SEGMENT([-i])
737 AT_CLEANUP
738 \f
739 AT_SETUP([BEGIN DATA command])
740 AT_KEYWORDS([segment])
741 AT_DATA([input], [dnl
742 begin data.
743 end data.
744
745 begin data. /*
746 123
747 xxx
748 end data.
749
750 BEG /**/ DAT /*
751 5 6 7 /* x
752
753 end  data
754 end data
755 .
756
757 begin
758  data.
759 data
760 end data.
761
762 begin data "xxx".
763 begin data 123.
764 not data
765 ])
766 AT_DATA([expout], [dnl
767 identifier      begin    space
768 identifier      data
769 end_command     .
770 newline         \n (data)
771
772 identifier      end    space
773 identifier      data
774 end_command     .
775 newline         \n (first)
776
777 separate_commands
778 newline         \n (first)
779
780 identifier      begin    space
781 identifier      data
782 end_command     .    space
783 comment         /*
784 newline         \n (data)
785
786 inline_data     123
787 newline         \n (data)
788
789 inline_data     xxx
790 newline         \n (data)
791
792 identifier      end    space
793 identifier      data
794 end_command     .
795 newline         \n (first)
796
797 separate_commands
798 newline         \n (first)
799
800 identifier      BEG    space
801 comment         /**/    space
802 identifier      DAT    space
803 comment         /*
804 newline         \n (data)
805
806 inline_data     5_6_7_/*_x
807 newline         \n (data)
808
809 inline_data     
810 newline         \n (data)
811
812 inline_data     end__data
813 newline         \n (data)
814
815 identifier      end    space
816 identifier      data
817 newline         \n (later)
818
819 start_command   .
820 newline         \n (first)
821
822 separate_commands
823 newline         \n (first)
824
825 identifier      begin
826 newline         \n (later)
827     space
828 identifier      data
829 end_command     .
830 newline         \n (data)
831
832 inline_data     data
833 newline         \n (data)
834
835 identifier      end    space
836 identifier      data
837 end_command     .
838 newline         \n (first)
839
840 separate_commands
841 newline         \n (first)
842
843 identifier      begin    space
844 identifier      data    space
845 quoted_string   "xxx"
846 end_command     .
847 newline         \n (first)
848
849 identifier      begin    space
850 identifier      data    space
851 number          123
852 end_command     .
853 newline         \n (first)
854
855 reserved_word   not    space
856 identifier      data
857 newline         \n (later)
858
859 end             <U+0000>
860 ])
861 PSPP_CHECK_SEGMENT([-i])
862 AT_CLEANUP
863 \f
864 AT_SETUP([DO REPEAT command])
865 AT_KEYWORDS([segment])
866 AT_DATA([input], [dnl
867 do repeat x=a b c
868           y=d e f.
869   do repeat a=1 thru 5.
870 another command.
871 second command
872 + third command.
873 end /* x */ /* y */ repeat print.
874 end
875  repeat.
876 do
877   repeat #a=1.
878   inner command.
879 end repeat.
880 ])
881 AT_DATA([expout], [dnl
882 identifier      do    space
883 identifier      repeat    space
884 identifier      x
885 punct           =
886 identifier      a    space
887 identifier      b    space
888 identifier      c
889 newline         \n (later)
890
891 spaces          __________
892 identifier      y
893 punct           =
894 identifier      d    space
895 identifier      e    space
896 identifier      f
897 end_command     .
898 newline         \n (DO REPEAT)
899
900 do_repeat_command __do_repeat_a=1_thru_5.
901 newline         \n (DO REPEAT)
902
903 do_repeat_command another_command.
904 newline         \n (DO REPEAT)
905
906 do_repeat_command second_command
907 newline         \n (DO REPEAT)
908
909 do_repeat_command +_third_command.
910 newline         \n (DO REPEAT)
911
912 do_repeat_command end_/*_x_*/_/*_y_*/_repeat_print.
913 newline         \n (DO REPEAT)
914
915 identifier      end
916 newline         \n (later)
917     space
918 identifier      repeat
919 end_command     .
920 newline         \n (first)
921
922 identifier      do
923 newline         \n (later)
924
925 spaces          __
926 identifier      repeat    space
927 identifier      #a
928 punct           =
929 number          1
930 end_command     .
931 newline         \n (DO REPEAT)
932
933 do_repeat_command __inner_command.
934 newline         \n (DO REPEAT)
935
936 identifier      end    space
937 identifier      repeat
938 end_command     .
939 newline         \n (first)
940
941 end             <U+0000>
942 ])
943 PSPP_CHECK_SEGMENT([-i])
944 AT_CLEANUP
945 \f
946 AT_SETUP([batch mode])
947 AT_KEYWORDS([segment])
948 AT_DATA([input], [dnl
949 first command
950      another line of first command
951 +  second command
952 third command
953
954 fourth command.
955    fifth command.
956 ])
957 AT_DATA([expout], [dnl
958 identifier      first    space
959 identifier      command
960 newline         \n (later)
961
962 spaces          _____
963 identifier      another    space
964 identifier      line    space
965 identifier      of    space
966 identifier      first    space
967 identifier      command
968 newline         \n (later)
969
970 start_command   +
971 spaces          __
972 identifier      second    space
973 identifier      command
974 newline         \n (later)
975
976 start_command
977 identifier      third    space
978 identifier      command
979 newline         \n (later)
980
981 separate_commands
982 newline         \n (first)
983
984 identifier      fourth    space
985 identifier      command
986 end_command     .
987 newline         \n (first)
988
989 spaces          ___
990 identifier      fifth    space
991 identifier      command
992 end_command     .
993 newline         \n (first)
994
995 end             <U+0000>
996 ])
997 PSPP_CHECK_SEGMENT([-b])
998 AT_CLEANUP
999 \f
1000 AT_SETUP([auto mode])
1001 AT_KEYWORDS([segment])
1002 AT_DATA([input], [dnl
1003 command
1004      another line of command
1005 2sls
1006 +  another command
1007 another line of second command
1008 data list /x 1
1009 aggregate.
1010 print eject.
1011 twostep cluster
1012
1013
1014 fourth command.
1015    fifth command.
1016 ])
1017 AT_DATA([expout], [dnl
1018 identifier      command
1019 newline         \n (later)
1020
1021 spaces          _____
1022 identifier      another    space
1023 identifier      line    space
1024 identifier      of    space
1025 identifier      command
1026 newline         \n (later)
1027
1028 start_command
1029 number          2
1030 identifier      sls
1031 newline         \n (later)
1032
1033 start_command   +
1034 spaces          __
1035 identifier      another    space
1036 identifier      command
1037 newline         \n (later)
1038
1039 identifier      another    space
1040 identifier      line    space
1041 identifier      of    space
1042 identifier      second    space
1043 identifier      command
1044 newline         \n (later)
1045
1046 start_command
1047 identifier      data    space
1048 identifier      list    space
1049 punct           /
1050 identifier      x    space
1051 number          1
1052 newline         \n (later)
1053
1054 start_command
1055 identifier      aggregate
1056 end_command     .
1057 newline         \n (first)
1058
1059 identifier      print    space
1060 identifier      eject
1061 end_command     .
1062 newline         \n (first)
1063
1064 identifier      twostep    space
1065 identifier      cluster
1066 newline         \n (later)
1067
1068 separate_commands
1069 newline         \n (first)
1070
1071 separate_commands
1072 newline         \n (first)
1073
1074 identifier      fourth    space
1075 identifier      command
1076 end_command     .
1077 newline         \n (first)
1078
1079 spaces          ___
1080 identifier      fifth    space
1081 identifier      command
1082 end_command     .
1083 newline         \n (first)
1084
1085 end             <U+0000>
1086 ])
1087 PSPP_CHECK_SEGMENT([-a])
1088 AT_CLEANUP