Skip to content

Commit

Permalink
chore: fix typo (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuschen authored Aug 26, 2024
1 parent da0eaee commit 4157169
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Lib/AST/Stat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Lib.AST.Stat
( pState,
pStateVariable,
pEmitStatement,
pCatchStatment,
pCatchStatement,
pTryStatement,
pDoWhileStatement,
pWhileStatement,
Expand Down Expand Up @@ -385,7 +385,7 @@ pTryStatement = do
(pManySpaces >> pOneKeyword leftCurlyBrace >> pManySpaces)
(pManySpaces >> pOneKeyword rightCurlyBrace >> pManySpaces)
(many pState)
catches <- many pCatchStatment
catches <- many pCatchStatement
return
TryStatement
{ tryExpr = expr,
Expand All @@ -394,8 +394,8 @@ pTryStatement = do
tryCatches = catches
}

pCatchStatment :: Parser CatchStatement
pCatchStatment = do
pCatchStatement :: Parser CatchStatement
pCatchStatement = do
ident <-
pOneKeyword "catch"
>> pMany1Spaces
Expand Down
7 changes: 6 additions & 1 deletion src/Lib/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Lib.Command (executeFile, executeProject) where

import Data.Text (Text, pack, unpack)
import Lib.AST.File (pWholeSolFile)
import Lib.AST.Model (ContractDefinition (contractName), SolFile (SolFile, solContracts, solFunctions))
import Lib.AST.Model (ContractDefinition (contractName), SolFile (SolFile, solContracts, solFunctions), FunctionDefinition (..))
import Lib.AST.Parser (runSParser)
import System.Directory (canonicalizePath, doesDirectoryExist, doesFileExist)
import System.Directory.Internal.Prelude (exitFailure)
Expand Down Expand Up @@ -41,3 +41,8 @@ executeProject folderPath = do
checkFile :: SolFile -> IO ()
checkFile SolFile {..} = do
foldMap (\c -> putStr "contract definition: " >> (print . contractName) c) solContracts

checkFunction :: FunctionDefinition -> Maybe Text
checkFunction FunctionDefinition{..} = do
return ""

2 changes: 1 addition & 1 deletion tests/Lib/AST/StatSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ parseCatchStatementSpec = do
""
)
]
forM_ testCases $ exactlyParserVerifier "catch statement only" pCatchStatment
forM_ testCases $ exactlyParserVerifier "catch statement only" pCatchStatement

parseEmitStatementSpec :: Spec
parseEmitStatementSpec = do
Expand Down

0 comments on commit 4157169

Please sign in to comment.