Skip to content

Instantly share code, notes, and snippets.

@jostyee
Forked from sha1sum/go.xml
Created July 11, 2020 12:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jostyee/391214f1b1917a3610b561973ee62c04 to your computer and use it in GitHub Desktop.
Save jostyee/391214f1b1917a3610b561973ee62c04 to your computer and use it in GitHub Desktop.
GOlang File Format for Beyond Compare
<?xml version="1.0" encoding="UTF-8"?>
<!-- Produced by Beyond Compare 4 from Scooter Software -->
<!--
This is an extension of the work done by Nate Finch:
https://npf.io/2014/05/diffing-go-with-beyond-compare/
The regular expressions for identifiers have been updated
to match on lowercase and allow numbers to be included anywhere
after the first character of the word.
Another "Exported Element" file format element has been added
that will match any word whose first character is uppercase. To
me, it helps to be able to identify between local/unexported
and exported.
-->
<BCFileFormats Version="1">
<TTextFormat Value="Go">
<CharPerLine Value="4096"/>
<CodePageDetect Value="True"/>
<ColBased Value="False"/>
<CommentCaseSig Value="True"/>
<ConvertKind Value="convertApp"/>
<ConvertLoadApp Value=""/>
<ConvertNoEdit Value="False"/>
<ConvertSaveApp Value="gofmt -w %t"/>
<CtrlZIsEOF Value="False"/>
<Description>
<_0 Value="- Compares Go source."/>
</Description>
<DirectiveCaseSig Value="True"/>
<Enabled Value="True"/>
<EnvironVarCaseSig Value="True"/>
<Grammar>
<_0 Value="TListTextGrammarItem">
<ElementStr Value="&#2;Keyword"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Items>
<_0 Value="break"/>
<_1 Value="default"/>
<_2 Value="func"/>
<_3 Value="interface"/>
<_4 Value="select"/>
<_5 Value="case"/>
<_6 Value="defer"/>
<_7 Value="go"/>
<_8 Value="map"/>
<_9 Value="struct"/>
<_10 Value="chan"/>
<_11 Value="else"/>
<_12 Value="goto"/>
<_13 Value="package"/>
<_14 Value="switch"/>
<_15 Value="const"/>
<_16 Value="fallthrough"/>
<_17 Value="if"/>
<_18 Value="range"/>
<_19 Value="type"/>
<_20 Value="continue"/>
<_21 Value="for"/>
<_22 Value="import"/>
<_23 Value="return"/>
<_24 Value="var"/>
</Items>
</_0>
<_1 Value="TBasicTextGrammarItem">
<ElementStr Value="&#2;Identifier"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="True"/>
<Text Value="[a-z][_A-Za-z0-9]*\w*"/>
</_1>
<_2 Value="TBasicTextGrammarItem">
<ElementStr Value="&#2;Number"/>
<CaseSensitive Value="False"/>
<IsRegExp Value="True"/>
<Text Value="(\d+(\.\d+)?(e[+-]?\d+)?)|(0x[a-f\d]+)"/>
</_2>
<_3 Value="TDelimitedTextGrammarItem">
<ElementStr Value="&#2;String"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Text Value="'"/>
<Escape Value="92"/>
<StopEOL Value="True"/>
<StopText Value="'"/>
</_3>
<_4 Value="TDelimitedTextGrammarItem">
<ElementStr Value="&#2;String"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Text Value="&quot;"/>
<Escape Value="92"/>
<StopEOL Value="True"/>
<StopText Value="&quot;"/>
</_4>
<_5 Value="TDelimitedTextGrammarItem">
<ElementStr Value="&#2;String"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Text Value="`"/>
<Escape Value="0"/>
<StopEOL Value="False"/>
<StopText Value="`"/>
</_5>
<_6 Value="TDelimitedTextGrammarItem">
<ElementStr Value="&#2;Comment"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Text Value="//"/>
<Escape Value="0"/>
<StopEOL Value="True"/>
<StopText Value=""/>
</_6>
<_7 Value="TDelimitedTextGrammarItem">
<ElementStr Value="&#2;Comment"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Text Value="/*"/>
<Escape Value="0"/>
<StopEOL Value="False"/>
<StopText Value="*/"/>
</_7>
<_8 Value="TListTextGrammarItem">
<ElementStr Value="&#2;Operator"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="False"/>
<Items>
<_0 Value="{"/>
<_1 Value="}"/>
<_2 Value="("/>
<_3 Value=")"/>
<_4 Value="["/>
<_5 Value="]"/>
<_6 Value="."/>
<_7 Value=":"/>
<_8 Value=","/>
<_9 Value=";"/>
<_10 Value="!"/>
<_11 Value="?"/>
<_12 Value="|"/>
<_13 Value="&amp;"/>
<_14 Value="+"/>
<_15 Value="-"/>
<_16 Value="/"/>
<_17 Value="*"/>
<_18 Value="="/>
<_19 Value=">"/>
<_20 Value="&lt;"/>
<_21 Value="%"/>
</Items>
</_8>
<_9 Value="TBasicTextGrammarItem">
<ElementStr Value="Exported Element"/>
<CaseSensitive Value="True"/>
<IsRegExp Value="True"/>
<Text Value="[A-Z][0-9A-Za-z]*\w"/>
</_9>
</Grammar>
<IdentifierCaseSig Value="True"/>
<IndentCaseSig Value="True"/>
<KeywordCaseSig Value="True"/>
<LabelCaseSig Value="True"/>
<LineBased Value="False"/>
<LineNumCaseSig Value="True"/>
<Mask Value="*.go"/>
<NumberCaseSig Value="True"/>
<OperatorCaseSig Value="True"/>
<StringCaseSig Value="True"/>
<TabAsSpaces Value="False"/>
<TabSize Value="8"/>
<TidyLeadingWS Value="False"/>
<TrimTrailingWS Value="False"/>
</TTextFormat>
</BCFileFormats>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment