fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
464 stars 156 forks source link

Problem in Literate.ParseScriptFile in 2.2.10-beta #82

Closed ovatsus closed 10 years ago

ovatsus commented 10 years ago

I only noticed this now as when I upgraded from 2.2.7-beta to 2.2.10-beta I only generated the docs, didn't rerun the DocumentationTests in FSharp.Data, but something broke. The several fsx files of FSharp.Data docs evaluate correctly in VS and FSI, but the documentation tests give this output in the current FSharp.Data master:

Processing 'library/CsvFile.fsx'

Processing 'library/CsvProvider.fsx'
((15, 32), (15, 33)) Unexpected symbol ')' in expression (library/CsvProvider.fsx)
((2, 0), (2, 4)) The value or constructor 'Date' is not defined (library/CsvProvider.fsx)
((2, 5), (2, 9)) The value or constructor 'Open' is not defined (library/CsvProvider.fsx)
((2, 10), (2, 14)) The value or constructor 'High' is not defined (library/CsvProvider.fsx)
((2, 15), (2, 18)) The value or constructor 'Low' is not defined (library/CsvProvider.fsx)
((2, 19), (2, 24)) The value or constructor 'Close' is not defined (library/CsvProvider.fsx)
((2, 25), (2, 31)) The value or constructor 'Volume' is not defined (library/CsvProvider.fsx)
((2, 32), (2, 35)) The value or constructor 'Adj' is not defined (library/CsvProvider.fsx)
((10, 0), (10, 4)) The value or constructor 'Name' is not defined (library/CsvProvider.fsx)
((10, 7), (10, 15)) The value or constructor 'Distance' is not defined (library/CsvProvider.fsx)
((10, 25), (10, 29)) The value or constructor 'Time' is not defined (library/CsvProvider.fsx)
((11, 0), (11, 5)) The value or constructor 'First' is not defined (library/CsvProvider.fsx)
((16, 0), (16, 5)) The value or constructor 'First' is not defined (library/CsvProvider.fsx)
Processing 'library/Freebase.fsx'

Processing 'library/Http.fsx'

Processing 'library/JsonProvider.fsx'
((2, 0), (2, 1)) Unexpected symbol ']' in definition. Expected incomplete structured construct at or before this point or other token. (library/JsonProvider.fsx)
Processing 'library/JsonValue.fsx'
((2, 0), (2, 1)) Unexpected symbol ']' in definition. Expected incomplete structured construct at or before this point or other token. (library/JsonValue.fsx)
Processing 'library/WorldBank.fsx'

Processing 'library/XmlProvider.fsx'
((2, 0), (2, 1)) Unexpected symbol '<' in definition. Expected incomplete structured construct at or before this point or other token. (library/XmlProvider.fsx)
((5, 0), (5, 2)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (library/XmlProvider.fsx)
((5, 0), (5, 2)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (library/XmlProvider.fsx)
((9, 0), (9, 1)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (library/XmlProvider.fsx)
((9, 0), (9, 1)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (library/XmlProvider.fsx)
Processing 'tutorials/JsonToXml.fsx'
((2, 0), (2, 1)) Unexpected symbol '<' in definition. Expected incomplete structured construct at or before this point or other token. (tutorials/JsonToXml.fsx)
((6, 0), (6, 2)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((6, 0), (6, 2)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((10, 0), (10, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((10, 0), (10, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((17, 0), (17, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((17, 0), (17, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((23, 0), (23, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
((23, 0), (23, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (tutorials/JsonToXml.fsx)
Processing 'experimental/ApiaryProvider.fsx'
((3, 0), (3, 1)) Unexpected symbol '<' in definition. Expected incomplete structured construct at or before this point or other token. (experimental/ApiaryProvider.fsx)
((2, 0), (2, 3)) The value or constructor 'GET' is not defined (experimental/ApiaryProvider.fsx)
((2, 7), (2, 14)) The value or constructor 'snippet' is not defined (experimental/ApiaryProvider.fsx)
((2, 15), (2, 19)) Invalid object, sequence or record expression (experimental/ApiaryProvider.fsx)
((2, 15), (2, 19)) Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' (experimental/ApiaryProvider.fsx)
Processing 'ja/library/CsvFile.fsx'

Processing 'ja/library/CsvProvider.fsx'
((15, 32), (15, 33)) Unexpected symbol ')' in expression (ja/library/CsvProvider.fsx)
((2, 0), (2, 4)) The value or constructor 'Date' is not defined (ja/library/CsvProvider.fsx)
((2, 5), (2, 9)) The value or constructor 'Open' is not defined (ja/library/CsvProvider.fsx)
((2, 10), (2, 14)) The value or constructor 'High' is not defined (ja/library/CsvProvider.fsx)
((2, 15), (2, 18)) The value or constructor 'Low' is not defined (ja/library/CsvProvider.fsx)
((2, 19), (2, 24)) The value or constructor 'Close' is not defined (ja/library/CsvProvider.fsx)
((2, 25), (2, 31)) The value or constructor 'Volume' is not defined (ja/library/CsvProvider.fsx)
((2, 32), (2, 35)) The value or constructor 'Adj' is not defined (ja/library/CsvProvider.fsx)
((10, 0), (10, 4)) The value or constructor 'Name' is not defined (ja/library/CsvProvider.fsx)
((10, 7), (10, 15)) The value or constructor 'Distance' is not defined (ja/library/CsvProvider.fsx)
((10, 25), (10, 29)) The value or constructor 'Time' is not defined (ja/library/CsvProvider.fsx)
((11, 0), (11, 5)) The value or constructor 'First' is not defined (ja/library/CsvProvider.fsx)
((16, 0), (16, 5)) The value or constructor 'First' is not defined (ja/library/CsvProvider.fsx)
Processing 'ja/library/Freebase.fsx'

Processing 'ja/library/Http.fsx'

Processing 'ja/library/JsonProvider.fsx'
((2, 0), (2, 1)) Unexpected symbol ']' in definition. Expected incomplete structured construct at or before this point or other token. (ja/library/JsonProvider.fsx)
Processing 'ja/library/JsonValue.fsx'
((2, 0), (2, 1)) Unexpected symbol ']' in definition. Expected incomplete structured construct at or before this point or other token. (ja/library/JsonValue.fsx)
Processing 'ja/library/WorldBank.fsx'

Processing 'ja/library/XmlProvider.fsx'
((2, 0), (2, 1)) Unexpected symbol '<' in definition. Expected incomplete structured construct at or before this point or other token. (ja/library/XmlProvider.fsx)
((5, 0), (5, 2)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (ja/library/XmlProvider.fsx)
((5, 0), (5, 2)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (ja/library/XmlProvider.fsx)
((9, 0), (9, 1)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (ja/library/XmlProvider.fsx)
((9, 0), (9, 1)) Possible incorrect indentation: this token is offside of context started at position (5:3). Try indenting this token further or using standard formatting conventions. (ja/library/XmlProvider.fsx)
Processing 'ja/tutorials/JsonToXml.fsx'
((2, 0), (2, 1)) Unexpected symbol '<' in definition. Expected incomplete structured construct at or before this point or other token. (ja/tutorials/JsonToXml.fsx)
((6, 0), (6, 2)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((6, 0), (6, 2)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((10, 0), (10, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((10, 0), (10, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((17, 0), (17, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((17, 0), (17, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((23, 0), (23, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
((23, 0), (23, 1)) Possible incorrect indentation: this token is offside of context started at position (6:3). Try indenting this token further or using standard formatting conventions. (ja/tutorials/JsonToXml.fsx)
Processing 'ja/experimental/ApiaryProvider.fsx'
((3, 0), (3, 1)) Unexpected symbol '<' in definition. Expected incomplete structured construct at or before this point or other token. (ja/experimental/ApiaryProvider.fsx)
((2, 0), (2, 3)) The value or constructor 'GET' is not defined (ja/experimental/ApiaryProvider.fsx)
((2, 7), (2, 14)) The value or constructor 'snippet' is not defined (ja/experimental/ApiaryProvider.fsx)
((2, 15), (2, 19)) Invalid object, sequence or record expression (ja/experimental/ApiaryProvider.fsx)
((2, 15), (2, 19)) Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' (ja/experimental/ApiaryProvider.fsx)

In CsvProvider.fsx it seems it's trying to evaluate stuff inside the (* ), and in JsonProvider.fsx it seems it's having problem with the triple quote literals

The compiler was resolved to the right one (4.3.0.0)

tpetricek commented 10 years ago

Could this be because I accidentally included FSharp.Core.dll in the NuGet package? (I think this will probably get simpler once F# Formatting stops using the mysterious soft binding...)

ovatsus commented 10 years ago

I tried deleting that FSharp.Core but I still got the same errors, so it must be something else

ovatsus commented 10 years ago

This no longer happens in latest

tpetricek commented 10 years ago

This was actually happening because F# formatting started colorizing snippets in comments, so I had to change:

(** foo

    snippet

To:

(** foo

    [lang=text]
    snippet