Skip to content

C言語のサンプルコードの実行機能対応 #70

Description

@saki7

cpprefjpにはC++だけではなくC言語のコードスニペットもあるが、今はMarkdown上のinfo stringが cpp ではなく c になっているコードは検知から外れている(example がついていても検知から外れる)。

これに対応するためには、一見すると以下の1行を切り替えれば大丈夫なように思えるが、

if (lang === 'cpp') {

実際にはC++とC言語は別の言語なので、上の行の修正に追加で バックエンド(Wandbox)で使用するコンパイラを分けなければならない。そのための該当箇所は以下の通り。

kunai/js/kunai/wand.js

Lines 119 to 123 in 4ea3bbe

static defaults = new Map([
['compiler', 'clang-head'],
['options', ['warning', 'c++2a', 'cpp-pedantic-errors']],
['compiler-option-raw', ['-Wall', '-Wextra', /*'-Werror'*/]],
])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions