From 90322ea107eb32d3100f1835b7260d6c919b4d08 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 3 Sep 2023 21:26:06 +0000 Subject: [PATCH] feat: Add support for doxygen `@note`. --- BUILD.bazel | 2 +- cimple.cabal | 150 +++++++++++++--------------- src/Language/Cimple/CommentParser.y | 1 + test/Language/Cimple/AstSpec.hs | 1 + 4 files changed, 73 insertions(+), 81 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 79476a0..d82e62a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -142,7 +142,7 @@ haskell_library( ], ), src_strip_prefix = "src", - version = "0.0.17", + version = "0.0.18", visibility = ["//visibility:public"], deps = [ ":ast", diff --git a/cimple.cabal b/cimple.cabal index f191ba3..97a2f48 100644 --- a/cimple.cabal +++ b/cimple.cabal @@ -1,57 +1,57 @@ -name: cimple -version: 0.0.17 -synopsis: Simple C-like programming language -homepage: https://toktok.github.io/ -license: GPL-3 -license-file: LICENSE -author: Iphigenia Df -maintainer: Iphigenia Df -copyright: Copyright (c) 2016-2022, Iphigenia Df -category: Data -stability: Experimental -cabal-version: >= 1.10 -build-type: Simple +name: cimple +version: 0.0.18 +synopsis: Simple C-like programming language +homepage: https://toktok.github.io/ +license: GPL-3 +license-file: LICENSE +author: Iphigenia Df +maintainer: Iphigenia Df +copyright: Copyright (c) 2016-2022, Iphigenia Df +category: Data +stability: Experimental +cabal-version: >=1.10 +build-type: Simple description: Parser and AST for Cimple, a simple C-like programming language. source-repository head - type: git - location: https://github.com/TokTok/hs-cimple + type: git + location: https://github.com/TokTok/hs-cimple library default-language: Haskell2010 - hs-source-dirs: - src - ghc-options: - -Wall - build-tools: alex, happy + hs-source-dirs: src + ghc-options: -Wall + build-tools: alex >=0, happy >=0 exposed-modules: - Language.Cimple - , Language.Cimple.Diagnostics - , Language.Cimple.IO - , Language.Cimple.MapAst - , Language.Cimple.Pretty - , Language.Cimple.Program - , Language.Cimple.TraverseAst + Language.Cimple + Language.Cimple.Diagnostics + Language.Cimple.IO + Language.Cimple.MapAst + Language.Cimple.Pretty + Language.Cimple.Program + Language.Cimple.TraverseAst + other-modules: - Language.Cimple.Annot - , Language.Cimple.Ast - , Language.Cimple.CommentParser - , Language.Cimple.DescribeAst - , Language.Cimple.Flatten - , Language.Cimple.Graph - , Language.Cimple.Lexer - , Language.Cimple.ParseResult - , Language.Cimple.Parser - , Language.Cimple.SemCheck.Includes - , Language.Cimple.Tokens - , Language.Cimple.TranslationUnit - , Language.Cimple.TreeParser + Language.Cimple.Annot + Language.Cimple.Ast + Language.Cimple.CommentParser + Language.Cimple.DescribeAst + Language.Cimple.Flatten + Language.Cimple.Graph + Language.Cimple.Lexer + Language.Cimple.Parser + Language.Cimple.ParseResult + Language.Cimple.SemCheck.Includes + Language.Cimple.Tokens + Language.Cimple.TranslationUnit + Language.Cimple.TreeParser + build-depends: - base < 5 - , aeson + aeson , ansi-wl-pprint , array + , base <5 , bytestring , containers , data-fix @@ -65,26 +65,22 @@ library executable cimplefmt default-language: Haskell2010 - hs-source-dirs: - tools - ghc-options: - -Wall - main-is: cimplefmt.hs + hs-source-dirs: tools + ghc-options: -Wall + main-is: cimplefmt.hs build-depends: - base < 5 + base <5 , bytestring , cimple , text executable dump-ast default-language: Haskell2010 - hs-source-dirs: - tools - ghc-options: - -Wall - main-is: dump-ast.hs + hs-source-dirs: tools + ghc-options: -Wall + main-is: dump-ast.hs build-depends: - base < 5 + base <5 , bytestring , cimple , groom @@ -92,13 +88,11 @@ executable dump-ast executable dump-tokens default-language: Haskell2010 - hs-source-dirs: - tools - ghc-options: - -Wall - main-is: dump-tokens.hs + hs-source-dirs: tools + ghc-options: -Wall + main-is: dump-tokens.hs build-depends: - base < 5 + base <5 , bytestring , cimple , groom @@ -106,33 +100,29 @@ executable dump-tokens executable include-graph default-language: Haskell2010 - hs-source-dirs: - tools - ghc-options: - -Wall - main-is: include-graph.hs + hs-source-dirs: tools + ghc-options: -Wall + main-is: include-graph.hs build-depends: - base < 5 + base <5 , cimple , groom test-suite testsuite - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: testsuite.hs + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: test + main-is: testsuite.hs other-modules: - Language.Cimple.AstSpec - , Language.Cimple.ParserSpec - , Language.Cimple.PrettySpec - ghc-options: - -Wall - -fno-warn-unused-imports - build-tool-depends: - hspec-discover:hspec-discover + Language.Cimple.AstSpec + Language.Cimple.ParserSpec + Language.Cimple.PrettySpec + + ghc-options: -Wall -Wno-unused-imports + build-tool-depends: hspec-discover:hspec-discover build-depends: - base < 5 - , ansi-wl-pprint + ansi-wl-pprint + , base <5 , cimple , data-fix , hspec diff --git a/src/Language/Cimple/CommentParser.y b/src/Language/Cimple/CommentParser.y index 1111d28..8a7f60f 100644 --- a/src/Language/Cimple/CommentParser.y +++ b/src/Language/Cimple/CommentParser.y @@ -30,6 +30,7 @@ import Language.Cimple.Tokens (LexemeClass (..)) '@deprecated' { L _ CmtCommand "@deprecated" } '@extends' { L _ CmtCommand "@extends" } '@implements' { L _ CmtCommand "@implements" } + '@note' { L _ CmtCommand "@note" } '@param' { L _ CmtCommand "@param" } '@private' { L _ CmtCommand "@private" } '@ref' { L _ CmtCommand "@ref" } diff --git a/test/Language/Cimple/AstSpec.hs b/test/Language/Cimple/AstSpec.hs index f89bf96..33c8ada 100644 --- a/test/Language/Cimple/AstSpec.hs +++ b/test/Language/Cimple/AstSpec.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-}