Changeset 4

Show
Ignore:
Timestamp:
05/23/07 19:47:51 (17 months ago)
Author:
oren
Message:

Fix a bug (greedy assigment of properties to collection instead of to entry, ypaste # 6).

Location:
trunk/YamlReference
Files:
12 added
13 removed
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/YamlReference/Text/Yaml/Reference.bnf

    r3 r4  
    653653s_l__flow_in_block  n   = s_separate n FlowOut & ns_flow_node (n .+ 1) FlowOut & s_l_comments 
    654654s_l__block_in_block n c = nest BeginNode 
    655                         & ( s_separate n c & c_ns_properties n c ?) 
    656                         & s_l__block_content n c 
     655                        & ( s_l__block_scalar n c / s_l__block_collection n c ) 
    657656                        & nest EndNode 
    658 s_l__block_content  n c = s_separate n c & c_l__literal n 
    659                         / s_separate n c & c_l__folded n 
    660                         / s_l_comments & l__block_sequence (seq_spaces n c) 
    661                         / s_l_comments & l__block_mapping n 
     657 
     658s_l__block_scalar     n c = s_separate n c & ( c_ns_properties n c & s_separate n c ?) 
     659                          & ( c_l__literal n / c_l__folded n ) 
     660s_l__block_collection n c = ( s_l_comments / ( s_separate n c & c_ns_properties n c & s_l_comments ) ) 
     661                          & ( l__block_sequence (seq_spaces n c)  / l__block_mapping n ) 
    662662 
    663663-- Document: 
  • trunk/YamlReference/Text/Yaml/Reference.hs

    r3 r4  
    470470-- that it is that easy to draw the line - is @sLine@ generic or specific?). 
    471471data State = State { 
    472     sName         :: !String,          -- ^ The input name for error messages. 
    473     sEncoding     :: !Encoding,        -- ^ The input UTF encoding. 
    474     sDecision     :: !String,          -- ^ Current decision name. 
    475     sLimit        :: !Int,             -- ^ Lookahead characters limit. 
    476     sForbidden    :: !(Maybe Pattern), -- ^ Pattern we must not enter into. 
    477     sIsPeek       :: !Bool,            -- ^ Disables token generation. 
    478     sChars        :: ![Char],          -- ^ (Reversed) characters collected for a token. 
    479     sOffset       :: !Int,             -- ^ Offset in characters in the input. 
    480     sLine         :: !Int,             -- ^ Builds on YAML's line break definition. 
    481     sColumn       :: !Int,             -- ^ Actually character number - we hate tabs. 
    482     sCode         :: !Code,            -- ^ Of token we are collecting chars for. 
    483     sLast         :: !Char,            -- ^ Last matched character. 
    484     sInput        :: ![Char]           -- ^ The decoded input characters. 
     472    sName      :: !String,          -- ^ The input name for error messages. 
     473    sEncoding  :: !Encoding,        -- ^ The input UTF encoding. 
     474    sDecision  :: !String,          -- ^ Current decision name. 
     475    sLimit     :: !Int,             -- ^ Lookahead characters limit. 
     476    sForbidden :: !(Maybe Pattern), -- ^ Pattern we must not enter into. 
     477    sIsPeek    :: !Bool,            -- ^ Disables token generation. 
     478    sChars     :: ![Char],          -- ^ (Reversed) characters collected for a token. 
     479    sOffset    :: !Int,             -- ^ Offset in characters in the input. 
     480    sLine      :: !Int,             -- ^ Builds on YAML's line break definition. 
     481    sColumn    :: !Int,             -- ^ Actually character number - we hate tabs. 
     482    sCode      :: !Code,            -- ^ Of token we are collecting chars for. 
     483    sLast      :: !Char,            -- ^ Last matched character. 
     484    sInput     :: ![Char]           -- ^ The decoded input characters. 
    485485  } 
    486486 
     
    14141414                 $ PAT(ns_s_flow_map_entries) 
    14151415                 $ PAT(ns_s_flow_seq_entries) 
    1416                  $ PAT(s_l__block_content) 
     1416                 $ PAT(s_l__block_collection) 
    14171417                 $ PAT(s_l__block_in_block) 
    14181418                 $ PAT(s_l__block_indented) 
    14191419                 $ PAT(s_l__block_node) 
     1420                 $ PAT(s_l__block_scalar) 
    14201421                 $ PAT(s_ns_flow_map_explicit_empty) 
    14211422                 $ PAT(s_ns_flow_map_explicit_entry) 
  • trunk/YamlReference/YamlReference.cabal

    r3 r4  
    2323                 \"immediately\" begin to generate output. The memory leak that 
    2424                 existed in previous version has been plugged. 
    25 Build-Depends:   base >= 2.0, HUnit >= 1.1, regex-compat >= 0.71, dlist >= 0.2 
     25Build-Depends:   base >= 2.0, HUnit >= 1.1, regex-compat >= 0.71, dlist >= 0.2, mtl 
    2626Exposed-Modules: Text.Yaml.Reference 
    2727Extensions:      CPP, MultiParamTypeClasses