Merge branch 'master' into topic-datepicker-cleanup

This commit is contained in:
Eli Flanagan 2017-12-30 13:47:06 -05:00
commit a4df7997b4
8 changed files with 56 additions and 21 deletions

View File

@ -1392,26 +1392,27 @@ doc/lib.m4: $(VERSIONFILE)
setversion: $(VERSIONSENSITIVEFILES) #$(call def-help,setversion, update version strings & bounds from $(VERSIONFILE) (might need -B) ) setversion: $(VERSIONSENSITIVEFILES) #$(call def-help,setversion, update version strings & bounds from $(VERSIONFILE) (might need -B) )
updateversion: setversion $(call def-help,updateversion, update version strings & bounds from $(VERSIONFILE) and commit (might need -B) ) updateversion: setversion $(call def-help,updateversion, update version strings & bounds from $(VERSIONFILE) and commit (might need -B) )
@read -p "please review changes then press enter to commit: $(VERSIONFILE) $(VERSIONSENSITIVEFILES)" @read -p "please review changes then press enter to commit $(VERSIONFILE) $(VERSIONSENSITIVEFILES)"
git commit -m "bump version strings & lower bounds to $(VERSION)" $(VERSIONFILE) $(VERSIONSENSITIVEFILES) git commit -m "bump version strings & lower bounds to $(VERSION)" $(VERSIONFILE) $(VERSIONSENSITIVEFILES)
# (re)generate a cabal file from its package.yaml definition # (re)generate a cabal file from its package.yaml definition
# XXX to avoid warnings, this hpack should be the same version as stack's built-in hpack # XXX to avoid warnings, this hpack should be the same version as stack's built-in hpack
%.cabal: $$(dir $$@)package.yaml #%.cabal: $$(dir $$@)package.yaml
hpack --silent $(dir $*) # hpack --silent $(dir $*)
#
gencabal: $(call def-help,gencabal, regenerate cabal files from package.yaml files with stack )
stack build --dry-run --silent
gencabal: $$(CABALFILES) #$(call def-help,gencabal, regenerate cabal files from package.yamls (might need -B) ) updatecabal: gencabal $(call def-help,updatecabal, regenerate cabal files and commit )
@read -p "please review changes then press enter to commit $(shell ls */*.cabal)"
updatecabal: gencabal $(call def-help,updatecabal, regenerate and commit cabal files (might need -B) ) git commit -m "update cabal files" $(shell ls */*.cabal)
@read -p "please review changes then press enter to commit: $(CABALFILES)"
git commit -m "update cabal files" $(CABALFILES)
# we call in shake for this job; so dependencies aren't checked here # we call in shake for this job; so dependencies aren't checked here
genmanuals: Shake #$(call def-help,genmanuals, regenerate embedded manuals (might need -B) ) genmanuals: Shake #$(call def-help,genmanuals, regenerate embedded manuals (might need -B) )
./Shake manuals ./Shake manuals
updatemanuals: genmanuals $(call def-help,updatemanuals, regenerate embedded manuals and commit (might need -B) ) updatemanuals: genmanuals $(call def-help,updatemanuals, regenerate embedded manuals and commit (might need -B) )
@read -p "please review changes then press enter to commit: $(shell ls hledger*/hledger*.{1,5,info,txt})" @read -p "please review changes then press enter to commit $(shell ls hledger*/hledger*.{1,5,info,txt})"
git commit -m "update embedded manuals" hledger*/hledger*.{1,5,info,txt} git commit -m "update embedded manuals" hledger*/hledger*.{1,5,info,txt}

View File

@ -24,6 +24,7 @@ import Prelude.Compat hiding (readFile)
import Control.Monad.Compat import Control.Monad.Compat
import Control.Monad.Except (ExceptT(..), runExceptT, throwError) --, catchError) import Control.Monad.Except (ExceptT(..), runExceptT, throwError) --, catchError)
import Control.Monad.State.Strict import Control.Monad.State.Strict
import Data.Char
import Data.Data import Data.Data
import Data.Default import Data.Default
import Data.Functor.Identity import Data.Functor.Identity
@ -599,7 +600,7 @@ rawnumberp = do
(firstSep, groups) <- option (Nothing, []) $ do (firstSep, groups) <- option (Nothing, []) $ do
leadingDigits <- some digitChar leadingDigits <- some digitChar
option (Nothing, [leadingDigits]) . try $ do option (Nothing, [leadingDigits]) . try $ do
firstSep <- oneOf sepChars firstSep <- oneOf sepChars <|> whitespaceChar
groups <- some digitChar `sepBy1` char firstSep groups <- some digitChar `sepBy1` char firstSep
return (Just firstSep, leadingDigits : groups) return (Just firstSep, leadingDigits : groups)
@ -614,11 +615,14 @@ rawnumberp = do
return (lastSep, fromMaybe [] digits) return (lastSep, fromMaybe [] digits)
-- make sure we didn't leading part of mistyped number -- make sure we didn't leading part of mistyped number
notFollowedBy $ oneOf sepChars notFollowedBy $ oneOf sepChars <|> (whitespaceChar >> digitChar)
return $ dbg8 "rawnumberp" (firstSep, groups, extraGroup) return $ dbg8 "rawnumberp" (firstSep, groups, extraGroup)
<?> "rawnumberp" <?> "rawnumberp"
-- | Parse a unicode char that represents any non-control space char (Zs general category).
whitespaceChar :: TextParser m Char
whitespaceChar = charCategory Space
-- test_numberp = do -- test_numberp = do
-- let s `is` n = assertParseEqual (parseWithState mempty numberp s) n -- let s `is` n = assertParseEqual (parseWithState mempty numberp s) n

View File

@ -1,4 +1,4 @@
-- This file has been generated from package.yaml by hpack version 0.21.2. -- This file has been generated from package.yaml by hpack version 0.20.0.
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --

View File

@ -267,7 +267,8 @@ Amounts consist of a number and (usually) a currency symbol or commodity name. S
`3 "green apples"`\ `3 "green apples"`\
`-$1,000,000.00`\ `-$1,000,000.00`\
`INR 9,99,99,999.00`\ `INR 9,99,99,999.00`\
`EUR -2.000.000,00` `EUR -2.000.000,00`\
`1 999 999.9455`
As you can see, the amount format is somewhat flexible: As you can see, the amount format is somewhat flexible:
@ -275,7 +276,8 @@ As you can see, the amount format is somewhat flexible:
- the commodity is a symbol, word, or phrase, on the left or right, with or without a separating space. - the commodity is a symbol, word, or phrase, on the left or right, with or without a separating space.
If the commodity contains numbers, spaces or non-word punctuation it must be enclosed in double quotes. If the commodity contains numbers, spaces or non-word punctuation it must be enclosed in double quotes.
- negative amounts with a commodity on the left can have the minus sign before or after it - negative amounts with a commodity on the left can have the minus sign before or after it
- digit groups (thousands, or any other grouping) can be separated by commas (in which case period is used for decimal point) or periods (in which case comma is used for decimal point) - digit groups (thousands, or any other grouping) can be separated by space or comma or period and should be used as separator between all groups
- decimal part can be separated by comma or period and should be different from digit groups separator
You can use any of these variations when recording data. However, there is some ambiguous way of representing numbers like `$1.000` and `$1,000` both may mean either one thousand or one dollar. By default hledger will assume that this is sole delimiter is used only for decimals. On the other hand commodity format declared prior to that line will help to resolve that ambiguity differently: You can use any of these variations when recording data. However, there is some ambiguous way of representing numbers like `$1.000` and `$1,000` both may mean either one thousand or one dollar. By default hledger will assume that this is sole delimiter is used only for decimals. On the other hand commodity format declared prior to that line will help to resolve that ambiguity differently:

View File

@ -1,4 +1,4 @@
-- This file has been generated from package.yaml by hpack version 0.21.2. -- This file has been generated from package.yaml by hpack version 0.20.0.
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --

View File

@ -100,11 +100,13 @@ type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget)
instance Yesod App where instance Yesod App where
approot = ApprootMaster $ appRoot . settings approot = ApprootMaster $ appRoot . settings
-- Store session data on the client in encrypted cookies, -- -- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes -- -- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend -- makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
(120 * 60) -- (120 * 60)
".hledger-web_client_session_key.aes" -- ".hledger-web_client_session_key.aes"
-- don't use session data
makeSessionBackend _ = return Nothing
defaultLayout widget = do defaultLayout widget = do
master <- getYesod master <- getYesod

View File

@ -1,4 +1,4 @@
-- This file has been generated from package.yaml by hpack version 0.21.2. -- This file has been generated from package.yaml by hpack version 0.20.0.
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --

View File

@ -43,6 +43,32 @@ hledger bal -f -
>>> >>>
>>>=1 >>>=1
# Space between digits groups
hledger bal -f - --no-total
<<<
2017/1/1
a 1 000.00 EUR
b -1 000.00 EUR
>>>
1 000.00 EUR a
-1 000.00 EUR b
>>>2
>>>=0
# Space between digits groups in commodity directive
hledger bal -f - --no-total
<<<
commodity 1 000.00 EUR
2017/1/1
a 1,000.00 EUR
b -1,000.00 EUR
>>>
1 000.00 EUR a
-1 000.00 EUR b
>>>2
>>>=0
# Default commodity # Default commodity
hledger bal -f - hledger bal -f -
<<< <<<