guile-syntax-highlight.git
15 months agoMakefile: Add publish target. master v0.1
David Thompson [Sun, 11 Mar 2018 00:48:55 +0000 (19:48 -0500)] 
Makefile: Add publish target.

15 months agoMakefile: Fix compiled Guile file installation directory.
David Thompson [Sun, 11 Mar 2018 00:48:13 +0000 (19:48 -0500)] 
Makefile: Fix compiled Guile file installation directory.

15 months agoAdd C lexer.
David Thompson [Sun, 11 Mar 2018 00:23:29 +0000 (19:23 -0500)] 
Add C lexer.

3 years agoUpdate Guix development snapshot.
David Thompson [Tue, 16 Feb 2016 20:05:14 +0000 (15:05 -0500)] 
Update Guix development snapshot.

3 years agobuild: Fix installation directories.
David Thompson [Tue, 16 Feb 2016 20:03:30 +0000 (15:03 -0500)] 
build: Fix installation directories.

* Makefile.am: Use $GUILE_EFFECTIVE_VERSION to install modules to the
  correct place.

3 years agoUpdate Guix development snapshot.
David Thompson [Tue, 16 Feb 2016 19:59:43 +0000 (14:59 -0500)] 
Update Guix development snapshot.

3 years agoAllow building with Guile 2.2.
David Thompson [Tue, 16 Feb 2016 19:30:39 +0000 (14:30 -0500)] 
Allow building with Guile 2.2.

3 years agoDelete parsers modules.
David Thompson [Tue, 16 Feb 2016 17:46:02 +0000 (12:46 -0500)] 
Delete parsers modules.

* syntax-highlight/parsers.scm: Delete.
* Makefile.am (SOURCES): Delete it.

3 years agoRewrite highlighters in terms of lexers.
David Thompson [Tue, 16 Feb 2016 17:45:26 +0000 (12:45 -0500)] 
Rewrite highlighters in terms of lexers.

3 years agoAdd lexers module.
David Thompson [Tue, 16 Feb 2016 17:44:24 +0000 (12:44 -0500)] 
Add lexers module.

This starts the transition away from the flawed parser combinators to
something really similar, but more capable.

* syntax-highlight/lexers.scm: New file.
* Makefile.am(SOURCES): Add it.

3 years agoguix: Add source field.
David Thompson [Thu, 22 Oct 2015 01:54:53 +0000 (21:54 -0400)] 
guix: Add source field.

3 years agoGracefully handle parse failures.
David Thompson [Thu, 22 Oct 2015 01:45:08 +0000 (21:45 -0400)] 
Gracefully handle parse failures.

* syntax-highlight.scm (highlight): Add remainder of code to result as a
  plain string if parsing fails.

3 years agoAdd (syntax-highlight utils) module.
David Thompson [Thu, 22 Oct 2015 01:43:18 +0000 (21:43 -0400)] 
Add (syntax-highlight utils) module.

* syntax-highlight.scm (string->stream): Move it.
* syntax-highlight/parsers.scm (stream->string): Likewise.
* syntax-highlight/utils.scm: New file.
* Makefile.am (SOURCES): Add it.

3 years agoxml: Reverse order of operations issue.
David Thompson [Thu, 22 Oct 2015 01:27:05 +0000 (21:27 -0400)] 
xml: Reverse order of operations issue.

Try to parse close tags before open tags.

* syntax-highlight/xml.scm (xml-highlighter): Switch order of
  'parse-close-tag' and 'parse-open-tag'.

3 years agoREADME: Explain the purely functional parser combinator API.
David Thompson [Tue, 20 Oct 2015 19:17:46 +0000 (15:17 -0400)] 
README: Explain the purely functional parser combinator API.

3 years agoREADME: Rephrase "Implementation details."
David Thompson [Mon, 19 Oct 2015 15:47:18 +0000 (11:47 -0400)] 
README: Rephrase "Implementation details."

3 years agoAdd XML highlighter.
David Thompson [Mon, 19 Oct 2015 13:12:50 +0000 (09:12 -0400)] 
Add XML highlighter.

* syntax-highlight/xml.scm: New file
* Makefile.am (SOURCES): Add it.
* README ("Supported Languages"): Add "XML."

3 years agoparsers: Fix variable shadowing issue.
David Thompson [Mon, 19 Oct 2015 13:10:54 +0000 (09:10 -0400)] 
parsers: Fix variable shadowing issue.

'parse-either' and 'parse-both' shadowed the 'stream' variable, causing
failure cases to sometimes return the wrong stream.  That is, a stream
that has consumed input characters, not the original stream.

* syntax-highlight/parsers.scm (parse-either, parse-both): Use
  'remainder' variable for leftover stream variables rather than
  shadowing 'stream'.

3 years agoparsers: Add parse-maybe.
David Thompson [Mon, 19 Oct 2015 13:10:31 +0000 (09:10 -0400)] 
parsers: Add parse-maybe.

* syntax-highlight/parsers.scm (parse-maybe): New procedure.

3 years agoparsers: Remove parse-never.
David Thompson [Mon, 19 Oct 2015 13:08:08 +0000 (09:08 -0400)] 
parsers: Remove parse-never.

This was a thinko.  It's redundant with 'parse-fail'.

* syntax-highlight/parsers.scm (parse-never): Delete.
  (parse-fail): Rewrite docstring.
  (parse-any, parse-each): Use 'parse-fail'.
* syntax-highlight/scheme.scm (parse-specials, parse-openers,
  parse-closers): Likewise.

3 years agoREADME: Add "Implementation details" section.
David Thompson [Mon, 19 Oct 2015 12:34:37 +0000 (08:34 -0400)] 
README: Add "Implementation details" section.

3 years agoscheme: Allow for custom special symbols.
David Thompson [Mon, 19 Oct 2015 01:50:20 +0000 (21:50 -0400)] 
scheme: Allow for custom special symbols.

The 'make-scheme-highlighter' procedure lets the user override what the
set of special symbols and regexps are, useful for adding/removing
context-specific symbols.

* syntax-highlight/scheme.scm (make-scheme-highlighter): New procedure.
  (scheme-highlighter): Define in terms of 'make-scheme-highlighter'.

3 years agoscheme: Tag symbols beginning with "define" as special.
David Thompson [Mon, 19 Oct 2015 00:54:01 +0000 (20:54 -0400)] 
scheme: Tag symbols beginning with "define" as special.

* syntax-highlight/scheme.scm (parse-symbol-chars,
  parse-specials/regexp): New procedures.
  (parse-keyword): Use 'parse-symbol-chars'.

3 years agoparsers: Add parse-regexp.
David Thompson [Mon, 19 Oct 2015 00:53:39 +0000 (20:53 -0400)] 
parsers: Add parse-regexp.

* syntax-highlight/parsers.scm (parse-regexp): New procedure.

3 years agoparsers: Add parse-filter.
David Thompson [Mon, 19 Oct 2015 00:53:19 +0000 (20:53 -0400)] 
parsers: Add parse-filter.

* syntax-highlight/parsers.scm (parse-filter): New procedure.

3 years agoparsers: Fix typo in docstring.
David Thompson [Sun, 18 Oct 2015 13:45:23 +0000 (09:45 -0400)] 
parsers: Fix typo in docstring.

* syntax-highlight/parsers.scm (tagged-parser): Fix typo in docstring.

3 years agoscheme: Remove commented code.
David Thompson [Sun, 18 Oct 2015 13:43:18 +0000 (09:43 -0400)] 
scheme: Remove commented code.

* syntax-highlight/scheme.scm: Remove commented code.

3 years agoparsers: Fix parse-delimited.
David Thompson [Sun, 18 Oct 2015 13:41:21 +0000 (09:41 -0400)] 
parsers: Fix parse-delimited.

The 'until' string needs to be reversed before stringification, since
the rest of the character list is in reverse order.

* syntax-highlight/parsers.scm (parse-delimited): Reverse 'until' string
  when stringifying.

3 years agoREADME: Mention that only Scheme is supported right now.
David Thompson [Sun, 18 Oct 2015 13:40:58 +0000 (09:40 -0400)] 
README: Mention that only Scheme is supported right now.

3 years agoFirst commit!
David Thompson [Sun, 18 Oct 2015 03:11:39 +0000 (23:11 -0400)] 
First commit!