jeff-hykin / better-cpp-syntax

💾 The source of VS Code's C++ syntax highlighting
GNU General Public License v3.0
155 stars 30 forks source link

`d9bc4796b0b` #630

Closed RedCMD closed 1 year ago

RedCMD commented 1 year ago

weird name

https://github.com/jeff-hykin/better-cpp-syntax/blob/b159c5efc8bd3248b07420713babf597e4dab363/autogenerated/cpp.tmLanguage.json#L1182 https://github.com/jeff-hykin/better-cpp-syntax/blob/b159c5efc8bd3248b07420713babf597e4dab363/autogenerated/cpp.tmLanguage.json#L1275 https://github.com/jeff-hykin/better-cpp-syntax/blob/b159c5efc8bd3248b07420713babf597e4dab363/autogenerated/cpp.tmLanguage.json#L5385 cuda and embedded also have it

related? https://github.com/jeff-hykin/better-cpp-syntax/issues/588

ah yes image I love HUB/STUB ASSY BRAKED 90X90X550MM 6000KG 10X335MM PCD BOLT-ON CAP TVZ TBD from Treadway :p

jeff-hykin commented 1 year ago

Whats the issue?

RedCMD commented 1 year ago

what's with the weird number? d9bc4796b0b is it intentional?

jeff-hykin commented 1 year ago

Yes, its auto-generated as a namespacing/scoping technique. In the source thats generating the tmLanguage file theres a feature for importing/exporting patterns. For modularity, a file can create any pattern name without fear of global namespace pollution.

For example:

file_a.rb creates #comment, uses it inside of #func (and exports #func) file_b.rb creates #comment with an extra lookahead-cancel, uses it inside of #preprocessor (and exports #preprocessor)

file_c.rb imports #func and #preprocessor and puts them in the the final tmLanguage file.

Normally this^ would create a problem as #comment from file_a would overwrite file_b's (or vice-versa). Instead both are given a prefix thats unique to the file they were generated in before being added to the tmLanguage file.

jeff-hykin commented 1 year ago

Its kind of sad that this is so rare, as it means most everything is defined in one monolithic source file.

Kacperek18 commented 1 year ago

kacperek18-94@wp.pl Kacperek18