Commit Graph

14 Commits

Author SHA1 Message Date
Zachary Snow e4135bb896 use strict State and Writer monads 2020-08-11 19:14:18 -04:00
Zachary Snow b8d512e31f remove unneeded imports 2020-04-05 13:45:22 -04:00
Rupert Swarbrick 78f3db8803 Fail more gracefully on mismatched `if/`elsif/`else/`endif
Without this patch, a stray `endif caused sv2v to take the tail of an
empty list. Now we raise a lexical error.

To do this, the patch pulls the "push" and "pop" logic for the
preprocessor condition stack into separate helper
functions (pushCondStack and popCondStack). It also defines some
helper functions for manipulating Cond's.

The patch also adds a documentation comment explaining what the
different values of Code meant (because I had to squint to work it
out).
2020-03-23 20:19:25 -04:00
Zachary Snow f44e3e808a add option to skip preprocessing 2020-03-18 20:02:20 -04:00
Zachary Snow ad21277eb5 support macro names comprised of macro args and macros 2020-02-16 22:18:12 -05:00
Zachary Snow 104f98011e support for string literals with macros
- adds support for using macros and macro arguments within the argument
  list to other macros
- fixes an issue where macros with arguments would have extraneous
  whitespace
- fixes handling of multiline string literals
2020-02-12 23:58:41 -05:00
Zachary Snow 3c08767b63 redesigned preprocessor and lexer 2020-02-06 23:33:13 -05:00
Zachary Snow d578aee5d9 conflate the preprocessor and lexer
This should make it much easier to add support for ``, `", macros with
arguments, etc., in the future.
2019-03-29 05:33:17 -04:00
Zachary Snow e69895af54 initial setup for combining pre-processor and lexer 2019-03-29 01:10:46 -04:00
Zachary Snow 0d9ed3e1fa updated CLI to support include dirs and multiple files 2019-03-28 19:55:53 -04:00
Zachary Snow 7e37fe4338 fix nested conditional preprocessor directives 2019-03-28 18:04:28 -04:00
Zachary Snow 9259fef249 tolerate spaces in numeric literals in line with the spec 2019-03-22 02:01:48 -04:00
Zachary Snow acfbdb07f8 completely rewrote preprocessor; more extensive directive support (include, timescale) 2019-03-18 05:00:23 -04:00
Zachary Snow 7bc81ef67b directory re-org; streamline build setup 2019-02-28 13:52:31 -05:00