Mercurial > urweb
comparison src/elab_ops.sml @ 1718:dd12d6d9e9a7
Add another rule to simplify record concatenations for pretty-printing
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 21 Apr 2012 14:06:03 -0400 |
parents | d6c45026240d |
children | ec47f49c6aa3 |
comparison
equal
deleted
inserted
replaced
1717:16ee7ff7f119 | 1718:dd12d6d9e9a7 |
---|---|
1 (* Copyright (c) 2008, Adam Chlipala | 1 (* Copyright (c) 2008, 2012, Adam Chlipala |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
480 case (c1, c2) of | 480 case (c1, c2) of |
481 ((CRecord (k, xcs1), loc), (CRecord (_, xcs2), _)) => (CRecord (k, xcs1 @ xcs2), loc) | 481 ((CRecord (k, xcs1), loc), (CRecord (_, xcs2), _)) => (CRecord (k, xcs1 @ xcs2), loc) |
482 | ((CRecord (_, []), _), _) => c2 | 482 | ((CRecord (_, []), _), _) => c2 |
483 | ((CConcat (c11, c12), loc), _) => reduceCon env (CConcat (c11, (CConcat (c12, c2), loc)), loc) | 483 | ((CConcat (c11, c12), loc), _) => reduceCon env (CConcat (c11, (CConcat (c12, c2), loc)), loc) |
484 | (_, (CRecord (_, []), _)) => c1 | 484 | (_, (CRecord (_, []), _)) => c1 |
485 | ((CRecord (k, xcs1), loc), (CConcat ((CRecord (_, xcs2), _), c2'), _)) => (CConcat ((CRecord (k, xcs1 @ xcs2), loc), c2'), loc) | |
485 | _ => (CConcat (c1, c2), loc) | 486 | _ => (CConcat (c1, c2), loc) |
486 end | 487 end |
487 | CMap _ => cAll | 488 | CMap _ => cAll |
488 | 489 |
489 | CUnit => cAll | 490 | CUnit => cAll |