xaizek / zograscope (License: AGPLv3 only) (since 2018-12-07)
Mainly a syntax-aware diff that also provides a number of additional tools.
Commit bf5546df2edae8dd372526762afdb19d3ef5ab99

Fix a typo: Language::isPseudoParam{ a => e }ter()
Author: xaizek
Author date (UTC): 2019-06-06 12:00
Committer name: xaizek
Committer date (UTC): 2019-06-06 12:00
Parent(s): 0a42875cad87c3a7ef1328c44e70510f670c40d3
Signing key: 99DC5E4DB05F6BE2
Tree: 1f74a282a6db83c33533f050f13a8aeab84aca11
File Lines added Lines deleted
src/Language.hpp 1 1
src/c/C11Language.cpp 1 1
src/c/C11Language.hpp 1 1
src/make/MakeLanguage.cpp 1 1
src/make/MakeLanguage.hpp 1 1
src/srcml/cxx/SrcmlCxxLanguage.cpp 1 1
src/srcml/cxx/SrcmlCxxLanguage.hpp 1 1
src/tooling/FunctionAnalyzer.cpp 1 1
File src/Language.hpp changed (mode: 100644) (index 2676612..a8e6c79)
... ... public:
87 87 virtual bool alwaysMatches(const Node *x) const = 0; virtual bool alwaysMatches(const Node *x) const = 0;
88 88 // Checks whether parameter node (as reported by `classify()`) represents a // Checks whether parameter node (as reported by `classify()`) represents a
89 89 // true parameter and not something like "no argument list". // true parameter and not something like "no argument list".
90 virtual bool isPseudoParamater(const Node *x) const = 0;
90 virtual bool isPseudoParameter(const Node *x) const = 0;
91 91 // Checks whether child node needs to be replaced in its parent with its // Checks whether child node needs to be replaced in its parent with its
92 92 // children. // children.
93 93 virtual bool shouldSplice(SType parent, const Node *childNode) const = 0; virtual bool shouldSplice(SType parent, const Node *childNode) const = 0;
File src/c/C11Language.cpp changed (mode: 100644) (index 5991ba6..72d0af9)
... ... C11Language::alwaysMatches(const Node *x) const
238 238 } }
239 239
240 240 bool bool
241 C11Language::isPseudoParamater(const Node *x) const
241 C11Language::isPseudoParameter(const Node *x) const
242 242 { {
243 243 return (x->label == "void"); return (x->label == "void");
244 244 } }
File src/c/C11Language.hpp changed (mode: 100644) (index fc32fe7..3e4de87)
... ... public:
63 63 virtual bool alwaysMatches(const Node *x) const override; virtual bool alwaysMatches(const Node *x) const override;
64 64 // Checks whether parameter node (as reported by `classify()`) represents a // Checks whether parameter node (as reported by `classify()`) represents a
65 65 // true parameter and not something like "no argument list". // true parameter and not something like "no argument list".
66 virtual bool isPseudoParamater(const Node *x) const override;
66 virtual bool isPseudoParameter(const Node *x) const override;
67 67 // Checks whether child node needs to be replaced in its parent with its // Checks whether child node needs to be replaced in its parent with its
68 68 // children. // children.
69 69 virtual bool shouldSplice(SType parent, virtual bool shouldSplice(SType parent,
File src/make/MakeLanguage.cpp changed (mode: 100644) (index 031463d..ce19e98)
... ... MakeLanguage::alwaysMatches(const Node *x) const
138 138 } }
139 139
140 140 bool bool
141 MakeLanguage::isPseudoParamater(const Node */*x*/) const
141 MakeLanguage::isPseudoParameter(const Node */*x*/) const
142 142 { {
143 143 return false; return false;
144 144 } }
File src/make/MakeLanguage.hpp changed (mode: 100644) (index 8092610..031c01b)
... ... public:
63 63 virtual bool alwaysMatches(const Node *x) const override; virtual bool alwaysMatches(const Node *x) const override;
64 64 // Checks whether parameter node (as reported by `classify()`) represents a // Checks whether parameter node (as reported by `classify()`) represents a
65 65 // true parameter and not something like "no argument list". // true parameter and not something like "no argument list".
66 virtual bool isPseudoParamater(const Node *x) const override;
66 virtual bool isPseudoParameter(const Node *x) const override;
67 67 // Checks whether child node needs to be replaced in its parent with its // Checks whether child node needs to be replaced in its parent with its
68 68 // children. // children.
69 69 virtual bool shouldSplice(SType parent, virtual bool shouldSplice(SType parent,
File src/srcml/cxx/SrcmlCxxLanguage.cpp changed (mode: 100644) (index 00caabb..36c38e3)
... ... SrcmlCxxLanguage::alwaysMatches(const Node *x) const
443 443 } }
444 444
445 445 bool bool
446 SrcmlCxxLanguage::isPseudoParamater(const Node *x) const
446 SrcmlCxxLanguage::isPseudoParameter(const Node *x) const
447 447 { {
448 448 return (x->label == "void"); return (x->label == "void");
449 449 } }
File src/srcml/cxx/SrcmlCxxLanguage.hpp changed (mode: 100644) (index d582ec3..1ad4de1)
... ... public:
64 64 virtual bool alwaysMatches(const Node *x) const override; virtual bool alwaysMatches(const Node *x) const override;
65 65 // Checks whether parameter node (as reported by `classify()`) represents a // Checks whether parameter node (as reported by `classify()`) represents a
66 66 // true parameter and not something like "no argument list". // true parameter and not something like "no argument list".
67 virtual bool isPseudoParamater(const Node *x) const override;
67 virtual bool isPseudoParameter(const Node *x) const override;
68 68 // Checks whether child node needs to be replaced in its parent with its // Checks whether child node needs to be replaced in its parent with its
69 69 // children. // children.
70 70 virtual bool shouldSplice(SType parent, virtual bool shouldSplice(SType parent,
File src/tooling/FunctionAnalyzer.cpp changed (mode: 100644) (index a618202..932edd9)
... ... FunctionAnalyzer::getParamCount(const Node *node) const
52 52 int paramCount = 0; int paramCount = 0;
53 53 for (const Node *child : node->children) { for (const Node *child : node->children) {
54 54 MType mtype = lang.classify(child->stype); MType mtype = lang.classify(child->stype);
55 if (mtype == MType::Parameter && !lang.isPseudoParamater(child)) {
55 if (mtype == MType::Parameter && !lang.isPseudoParameter(child)) {
56 56 ++paramCount; ++paramCount;
57 57 } else if (mtype == MType::Declaration || mtype == MType::Other) { } else if (mtype == MType::Declaration || mtype == MType::Other) {
58 58 paramCount += getParamCount(child); paramCount += getParamCount(child);
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/zograscope

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/zograscope

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master